Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP.dbf to Access.mdb
Message
From
02/01/2002 17:40:56
Gavin Reid
L & M Marketing Pty Ltd
Frenchs Forest, Australia
 
 
To
02/01/2002 15:41:33
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00599945
Message ID:
00600000
Views:
17
This message has been marked as a message which has helped to the initial question of the thread.
Hi Paige,

You could use ADO.
oDatabaseConnection = CreateObject("ADODB.Connection")

oDatabaseConnection.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\mypath\mydatabase.mdb")

oRstMyTable = CreateObject("ADODB.Recordset")
oRstMyTable.ActiveConnection = oDatabaseConnection
oRstMyTable.LockType = 3 && LockOptimistic
oRstMyTable.Source = "mytable"
oRstMyTable.Open

oRstMyTable.AddNew

oRstMyTable.Fields("firstname") = "First"
oRstMyTable.Fields("lastname")  = "Last"

oRstMyTable.Update

oRstMyTable.Close

RELEASE oRstMyTable

oDatabaseConnection.Close

RELEASE oDatabaseConnection
Hope this helps,
Gavin...

>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform