Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP.dbf to Access.mdb
Message
De
02/01/2002 17:40:56
Gavin Reid
L & M Marketing Pty Ltd
Frenchs Forest, Australie
 
 
À
02/01/2002 15:41:33
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00599945
Message ID:
00600000
Vues:
18
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform