Hi!
No need to use SQLPrepare. You can use "?" just in SQLEXEC(). SQLPrepare have very limited use, because it is beneficial only in very narrow range of cases in programming. Specially with Parameters with "?" SQLPrepare() will slow down things a bit.
>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...
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.comICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs
It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.