campagnolo1
Technical User
Hello everyone,
I've been chasing my tail here for a while and could use some help. I have a FoxPro exe that runs a bunch of queries and puts them in a cursor. In the end the exe copies the final cursor into a dbf but I want it now to put the data into a SQL table. I created the SQL table with the exact columns and data types that the cursor has. But I'm having issues on getting the data into the SQL table. I have tried this:
and this works but of course puts the value "test" in the column and not the actual cursor value. If I try something like this:
I get a -1 and nothing gets entered in the database.
What syntax do I need to use to get all values from my cursor into the sql table?
Thanks a lot in advance for the help!
Cheers,
Chris
I've been chasing my tail here for a while and could use some help. I have a FoxPro exe that runs a bunch of queries and puts them in a cursor. In the end the exe copies the final cursor into a dbf but I want it now to put the data into a SQL table. I created the SQL table with the exact columns and data types that the cursor has. But I'm having issues on getting the data into the SQL table. I have tried this:
Code:
Select C5.*, bmsl.findno, bmsl.scrpad;
FROM C5 Left Join bmsl On C5.fg + C5.partno + C5.sorev = bmsl.itemparent + bmsl.itemchild + bmsl.rev;
INTO Cursor C6
connstr = SQLSTRINGCONNECT("Driver={SQL Server}; Server=KOKATAT-507BB64\SQLExpress; Database=WebPortal;Trusted Connection=Yes")
execmd = "INSERT INTO itemprojimstock (Item) VALUES (?'test')"
?SQLEXEC(connstr, execmd)
SQLDISCONNECT(connstr)
CLOSE ALL
Code:
execmd = "INSERT INTO itemprojimstock (Item) FROM C6 SELECT item WHERE C6.item <> ('')"
What syntax do I need to use to get all values from my cursor into the sql table?
Thanks a lot in advance for the help!
Cheers,
Chris