Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Sever - Update not working
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00405730
Message ID:
00405842
Views:
18
>>lnSqlHndl = sqlconnect('mydsn')
>>lcSql = 'update mysqltable set myfield1 = "value1" where myfield2 = "value2"'
>>sqlExec(lnSqlHndl,lcSql)
>>
>>SqlExec keeps returning -1 even though lnSqlHndl represents a valid handle. MyDsn uses windows authentication. The table permissions are set so everyone has rights to everything. I checked my sql syntax in the query analyser and it works in there. I can't figure out what's going on.
>>
>>I'm useing Win2k server with Sql Server 7.0.
>

>Rip,
>
>Use AERROR(laError) to get error information into array laError.
>If laError[1,1] = 1526 than ODBC error message will be in laError[1,3].


Thanks for the tip. It lead me to the fact that lcSql was formated wrong. For some reason it needed to have single quotes around the values instead of double quotes. Below is the line I changed that fixed the problem

lcSql = "update mysqltable set myfield1 = 'value1' where myfield2 = 'value2'"
Rip Ryness
International Falls, MN
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform