Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Passthru
Message
From
08/11/2002 02:09:40
 
General information
Forum:
Visual FoxPro
Category:
Client/server
Title:
Miscellaneous
Thread ID:
00719981
Message ID:
00720152
Views:
25
>>sqlexec(iCH, "insert into table (field1,field2) values (?oRec.field1, ?oRec.Field2)")

You are sending a string to SQL Server that includes references to an object that exists only in your application. Try:
cSql = "Insert into table(field1, fields2) values ("
cSql = cSql + "'" + oRec.Field1 + "', "  && Field 1 contains a string, needs single quotes
cSql = cSql + STR(oRec.Field2,5,0) + ")"  && Field 2 contains a number, but we are creating a string here
SQLEXEC(iCH,cSql)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform