>Hmmm... This fails each time. It is SQL Server 2005 from Foxpro 9.
>
>use SyncBoxQuery
>SCAN NEXT 20
>text to m.lcSQL noshow
> INSERT INTO Sync_Box (;
> shiplist, charges, ship_date, inpart, hold_date, custnum, box_id, ship_to, ship_via, ship_when) ;
> VALUES (;
> ?shiplist, ?charges, ?ship_date, ?inpart, ?hold_date, ?custnum, ?box_id, ?ship_to, ?ship_via, ?ship_when)")
>ENDTEXT
>lnsuccess = SQLEXEC(m.gnConnHandle, m.lcSQL)
Scan? Then there is a cursor/table in question. Alias the parameters:
...
VALUES (;
?myCursor.shiplist, ?myCursor.charges, ...
With SQL 2005 you don't need pretext and code like:
insert into myTable
(myField1, myField2)
--Comment about what is being inserted
values
--Another inline comment
(?myCursor.v1,?myCursor.v2)
PS: Tip: From SQL management studio query window you can copy the code that works and paste in text...endtext section (adjust parameters if needed).
Cetin