Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Data update in SQL Server
Message
 
To
24/11/2006 10:05:15
General information
Forum:
Visual FoxPro
Category:
Client/server
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
MS SQL Server
Miscellaneous
Thread ID:
01172264
Message ID:
01172275
Views:
8
>Hi,
>
>I am using Visual Foxpro 9 with SQL Server 2000. My table contains approx. 40 fields.
>I am using a temporary cursor for my form and then using SqlExec() command to update records to SQL Server from memory.
>The problem is that the sql string becomes too long , approx. 1000 words, which gives error and i am not able to update my table in sql server.
>
>Is there any other way to update SQL server database except making a remote view as for that we have to create a DSN or connection and which reqires SQL Server name to be hardcoded and limits your software to be deployed easily.
>
>SQLExec(g_connection,"update tabcurrent (sno,field1,field2,...) values ('"+m.sno+","'+m.field1+"'...
>
>Please help

There is no such a command like
UPDATE Table (fieldlist) VALUES (some valies)
This is syntax for INSERT command


try:
TEXT TO lcUpdate NOSHOW PRETEXT 15 TEXTMERGE
     update tabcurrent SET sno    = '<<m.sno>>',
                           field1 = '<<m.field1>>',
                           field2 = '<<m.field2>>'
ENDTEXT
SQLEXEC(g_connection, lcUpdate )
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform