Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQLEXEC RETURNS -1
Message
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00515582
Message ID:
00515650
Views:
13
It may mean you have a syntax error. After building this SQL string do a StrToFile(Sql_Str,'SQl_Str.txt'). Then you may examine the string offline for any problems like missing quotes etc. Plus you may alter the string and manually call the sqlexec from the command window for testing.

>Hello All:
> Is there a setting I have to set for using sqlexec(), I am getting -1 from the following code:
>
>SQL_STR = "UPDATE ClientType SET clEntity = '"+ m.entity +"',;
> clFirst1 = '"+ m.clFirst1 +"',clMI1 = '"+ m.clMI1 +"',;
> clLast1 = '"+ m.clLast1 +"', clFrist2 = '"+ m.clFirst2 +"',;
> clMI2 = '"+ m.clMI2 +"',clLast2 = '"+ m.clLast2 +"',;
> clName = '"+ m.clName +"',clDBA = '"+ m.clDBA +"';
> clZip = '"+ m.zip +"' where clClientID = '"+ M.CLIENT_ID +"'"
>
>OUTPUT=SQLEXEC(gnquoteConn,SQL_STR)
>
>if I take out some of the fields from sql_str it will work:
>SQL_STR = "UPDATE ClientType SET clEntity = '"+ m.entity +"',;
> clFirst1 = '"+ m.clFirst1 +"',clMI1 = '"+ m.clMI1 +"',;
> clLast1 = '"+ m.clLast1 +"',clCity = '"+ m.city +"',;
> clState = '"+ m.State +"',clAddr2 = '"+ m.Addr2 +"',;
> clAddr1 = '"+ m.addr1 +"',clZip = '"+ m.zip +"';
> where clClientID = '"+ M.CLIENT_ID +"'"
>The help file indicates that sqlexec() returns -1 there is a connection level error. what does it mean? The connection did not drop? help.
>sherry
>
Previous
Reply
Map
View

Click here to load this message in the networking platform