Board index » delphi » Sql Insert Error

Sql Insert Error


2007-01-18 12:59:08 AM
delphi61
I am getting the message "the field is too small to accept the amount of
data you attempted to add. Try inserting or pasting less data". I really do
not want to make my text field so large just to handle a few users incoming
data that may be to large for my description field. Is there a way around
this to force it to truncate the data?
Using ADO command component and inserting into MS Access.
Thanks!
 
 

Re:Sql Insert Error

Jeff,
Either
Set maxlength in the control you are using for input.
Or
Use leftStr in the beforepost of your ado component or when setting the
field value for a sql statement..
Bill
"Jeff" <XXXX@XXXXX.COM>writes
Quote
I am getting the message "the field is too small to accept the amount of
data you attempted to add. Try inserting or pasting less data". I really do
not want to make my text field so large just to handle a few users incoming
data that may be to large for my description field. Is there a way around
this to force it to truncate the data?

Using ADO command component and inserting into MS Access.

Thanks!

 

Re:Sql Insert Error

Jeff writes:
Quote
I am getting the message "the field is too small to accept the amount
of data you attempted to add. Try inserting or pasting less data". I
really do not want to make my text field so large just to handle a
few users incoming data that may be to large for my description
field. Is there a way around this to force it to truncate the data?

Using ADO command component and inserting into MS Access.

Thanks!
check the OnSetText event handler for a TField
--
Best regards :)
Guillem Vicens Meier
Dep. Informatica Green Service S.A.
www.clubgreenoasis.com
 

Re:Sql Insert Error

Do you have an example of the syntax that would be used in an SQL statement.
Here is my sql statement.
INSERT INTO [Temp_Import] ([Item Number],[Description]) SELECT [Access Item
Number],[Description] FROM [Cubiscan data to upload2.txt] IN "C:\Documents
and Settings\jth\Desktop\" "Text;"
The Description field is the one that is getting me.
"Bill Hannan" <XXXX@XXXXX.COM>writes
Quote
Jeff,

Either
Set maxlength in the control you are using for input.
Or
Use leftStr in the beforepost of your ado component or when setting the
field value for a sql statement..

Bill
"Jeff" <XXXX@XXXXX.COM>writes
news:45ae555a$XXXX@XXXXX.COM...
>I am getting the message "the field is too small to accept the amount of
>data you attempted to add. Try inserting or pasting less data". I really
>do not want to make my text field so large just to handle a few users
>incoming data that may be to large for my description field. Is there a
>way around this to force it to truncate the data?
>
>Using ADO command component and inserting into MS Access.
>
>Thanks!
>


 

Re:Sql Insert Error

"Jeff" <XXXX@XXXXX.COM>сообщи?сообщила ?новостях следующе?
Quote
Do you have an example of the syntax that would be used in an SQL
statement.

Here is my sql statement.

INSERT INTO [Temp_Import] ([Item Number],[Description]) SELECT [Access
Item Number],[Description] FROM [Cubiscan data to upload2.txt] IN
"C:\Documents and Settings\jth\Desktop\" "Text;"

The Description field is the one that is getting me.
Something like this should do the trick:
INSERT INTO [Temp_Import] ([Item Number],[Description]) SELECT [Access
Item
Number],Left([Description], <put here length of Temp_ImportDescription.>)
FROM [Cubiscan data to upload2.txt] IN "C:\Documents
and Settings\jth\Desktop\" "Text;"