Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Allowable Length of SQL command text in SQLEXEC() ?
Message
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00565734
Message ID:
00566775
Views:
15
Hi,

With the MSSQL Server ODBC Driver, under VFP6, my understanding is that the SQL statement has to be less than 7,600 characters. I think where you are getting the error is in the value of a field that you are trying to update through the SQL statement. For instance if you have a text box and you say
lcSQL = [UPDATE Table SET Text = ".........400 character text string ....."]
This string sent to SQL blows up with the error you speak of. To get around that error you have to send the following:
lcUpdateText = ".........400 character text string ....."
lcSQL = [UPDATE Table SET Text = ?lcUpdateText]
lnX = SQLEXEC(lnHandle,lcSQL)
Check your SQL statement and parameterize as many of the items as you can. If the parameter is a VFP cursor or table reference send ?Table.Field.

HTH,

Bill

>Hi!
>
>As far as I know, this is very depended on the ODBC driver and a kind of the command you going to send.
>
>Just test it. Something like following in command window (for SQL Server):
>
>
>nn = SQLStringConnect(...)
>=SQLEXEC(nn,"CREATE TABLE ttt (ttt int)")
>strSQL = replicate("INSERT INTO ttt values (2)",5000)
>=SQLEXEC(nn,strSQL)
>=SQLEXEC(nn,"select count(*) as cnt from ttt",ttt)
>sele ttt
>brow last
>NumChars = ttt.cnt*len(("INSERT INTO ttt values (2)")
>? NumChars
>
>
>HTH.
>
>
>
>>I have experienced an apparent limit of 255 chars length for the text within a SQLEXEC() command? Any Ideas as to what is going on? I thought the limit was supposed to be about 64K.
>>
>>Many thanks for any inputs
>>
>>Dick Balluff
>>RLB Associates
>>can be reached here or via rlb@surewest.net
>>(916)789-8855
CySolutions, Medical Information Technology
You're only as good as your last
success, so . . .If it works. . .don't fix it!
Previous
Reply
Map
View

Click here to load this message in the networking platform