Hi Michael,
Prefix the variable in the SQL statement with a question mark.
lcCustomerID = "CUST01"
lnResult=SQLExec(lnHandle,'SELECT * FROM MyTable WHERE CustomerID=?lcCustomerID')
Regards,
Liam
>What would be the proper approach to benefit of the use of a variable in a SQLExec()? For example, I have a lcCustomerID variable that I would like to use such as:
>
>
>lnResult=SQLExec(lnHandle,'SELECT * FROM MyTable WHERE CustomerID=lcCustomerID')
>
>
>I don't want to parse the value of lcCustomerID in the SQLExec() comment. I would like to preserve the Visual FoxPro variable as is and make use of it within the SQL.
Liam O'Hagan
MCP VFP Desktop Apps