Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Vfp -> sql server Insert cmd syntax error
Message
De
09/07/2004 15:45:05
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Vfp -> sql server Insert cmd syntax error
Divers
Thread ID:
00922683
Message ID:
00922683
Vues:
201
Hi, all

I am working in vfp 6 and MSDE (soon to go up to SQL server). I am using SQL pass-thru.

I am trying to execute the following code several different ways, but keep getting errors from the server:

lcVal1 = "Walsh"
lcVal2 = "Elizabeth"
lcSQLstr = 'INSERT INTO studnt (last_name_, firstname_, studnt_id_ )' + ;
' VALUES ('+ lcVal1 + ',' + lcVal2 + ',' + '1)'
llReturnVal=SQLEXEC(ghConnectionhandle,lcSQLstr)

lcSQLstr = 'INSERT INTO studnt (last_name_, firstname_, studnt_id_ )' + ;
' VALUES ( "Walsh", "Elizabeth", 1)'
llReturnVal=SQLEXEC(ghConnectionhandle,lcSQLstr)
forgot to add the error: Walsh is a column name and cannot be used.
any ideas on how to fix this?

TIA
Beth
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform