>I am trying to insert records into an access database from foxpro.
>
>If I list my values explicitly, it works.
>But, if I put variables in, it doesn't work.
>
>Example:
>Works:
>STORE SQLCONNECT('RACE1') TO hndODBCIN
>sqlexec(hndodbcin,"insert into table2 values ('T1','T2')")
>
>Doesn't work:
>a= 'T1'
>b = 'T2'
>STORE SQLCONNECT('RACE1') TO hndODBCIN
>sqlexec(hndodbcin,"insert into table2 values (a,b)")
>
>Any ideas on how I can insert records in the access database?
>Has anyone had luck updating records in an access database?
>
>Thank you so much for your help, in advance.
>Laurie
Try
STORE SQLCONNECT('RACE1') TO hndODBCIN
sqlexec(hndodbcin,"insert into table2 values (?m.a,?m.b)")
If it's not broken, fix it until it is.
My Blog