Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Insert into Access Database from foxpro
Message
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01397090
Message ID:
01397091
Views:
64
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform