Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP.dbf to Access.mdb
Message
From
02/01/2002 17:12:15
 
 
To
02/01/2002 15:41:33
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00599945
Message ID:
00599985
Views:
32
This message has been marked as a message which has helped to the initial question of the thread.
Paige,
Happy New Year!

You could also use SQL passthrough:
*-- build connection string
lcConnectionStr = "DRIVER={Microsoft Access Driver (*.mdb)};" +;
                  "Dbq=c:\temp\northwind.mdb;" +;
                  "Uid=Admin;" +;
                  "Pwd=;"

*-- connect to Access database
lnAccess = SQLSTRINGCONNECT(lcConnectionStr)

*-- add a record to the customers table
?SQLEXEC(lnAccess, "INSERT INTO customers (customerId, companyName) VALUES('X0001', 'Customer added through VFP')")

*-- or using memvars:
m.customerId = "X0002"
m.companyName = "Another Customer added through VFP"
?SQLEXEC(lnAccess, "INSERT INTO customers (customerId, companyName) VALUES('" + m.customerId +"', '" + m.companyname + "')")
HTH
>Happy New Year All,
>
>I'm trying to create a record in an MS Access table, from VFP 6/7 and populate it with data from VFP variables. This will probably require some VBA code. I have Della Martin's book on MS Office Automation w/ VFP (which I've used extensively) but it doesn't mention MS Access. It's been a while since I've accessed the UT knowledge base and I'm not sure how to do it with our new interface. Any suggestions will be appreciated. TIA.
>
>Regards,
>
>Paige
Daniel
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform