Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SPT INSERT syntax error?
Message
 
À
20/07/1998 19:10:47
Brian Lee
World Access Network, Inc.
Vancouver, Washington, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00119512
Message ID:
00119515
Vues:
21
I see two problems with your syntax. The first is that you need VALUES not VALUE. This works in VFP because most commands in VFP can be abbreviated to four or more characters, but SQL Server doesn't support that. Also, SQL Server won't know what curs.col1, etc. are. Put a question mark before each VFP expression to have VFP resolve the expression before sending the command to the ODBC driver. Try this:

= SQLExec(nConnect, "INSERT INTO sqltable (col1,col2,col3...) VALUES (?curs.col1, ?curs.col2, etc..)")

>Since TABLEUPDATE() seems rather unreliable for INSERTing new table rows back to SQL Server 6.5 through Remote Views, I'm now trying SQL Pass-Through functions to send an INSERT back to the server. No such luck, I keep getting syntax errors and connectivity errors. I've tried the syntax a hundred different ways, it seems - still no success. If anyone can shed light here, it would be greatly appreciated.
>
>I APPEND BLANK to cursor, then REPLACE data in all fields. Now I send
>= SQLExec(nConnect, "INSERT INTO sqltable (col1,col2,col3...) VALUE (curs.col1, curs.col2, etc..)")
>
>I've initialized all required elements using CURSORSETPROP().
>I've tried the SQLExec a variety of ways, using various delimiters, specifying each value, not specifying, etc. etc. What am I doing wrong? SELECT and UPDATE's work fine, only INSERT's do not. Thanks.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform