Hi,
use parameters markers instead.
e.g.
lcSQL = 'UPDATE yourTable SET field1 = ?yourVariable1, field2 = ?yourVariable2 WHERE primary_key = ?yourPK'
?SQLEXEC(lnConnection,lcSQL)
there are several advantages to this approach:
-the SQL statement will be fixed lenght and does not depent on the data beeing send
-the SQL statement cannot be invalidated by the data beeing sent, with your current approach when a variable contains a ' character for example the SQL statement is no longer valid (variable content: "St' something" - SQL: SET someField = 'St' something')
-you don't have to deal with the datatype conversions, FoxPro knows howto correctly pass parameters in a SQL statement
Regards
Christian