Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Vfp -> sql server Insert cmd syntax error
Message
From
09/07/2004 15:45:05
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Vfp -> sql server Insert cmd syntax error
Miscellaneous
Thread ID:
00922683
Message ID:
00922683
Views:
202
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
Next
Reply
Map
View

Click here to load this message in the networking platform