General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Vfp -> sql server Insert cmd syntax error
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only