Viola -- I guess I figured it out. The key is using the SQLPREPARE function and passing in variables/parameters with the ?mDIV_NUM syntax.
What worked is as follows:
mDIV_NUM = DIV_NUM
lnResult = SQLPREPARE(hConn, 'INSERT INTO EXPORT (DIV_NUM) VALUES (?mDIV_NUM)')
lnResult = SQLEXEC(hConn)
DIV_NUM is a numeric field in both the source VFP free table and the target SQL Server table. Hope this syntax also works for the other non-character field types. What a goat rope.
And Yep! I agree the table name EXPORT is bad, but that's what I inherited. I plan to change it in SQL Server to EXPORT1 or something else.
Thanks for pointing out the TTOC function that I had never used. It will be useful going forward.
Thanks for feedback provided -- I can go to bed now...
Previous
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