Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ADOX and access databases
Message
De
12/11/2002 10:35:00
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00721347
Message ID:
00721608
Vues:
9
>Hi
>
>Anyone have some examples for create and manipulate access databases using ADOX from Visual FoxPro?
>
>TIA

Hi Rodrigo,

Check the code and comments below:
*-- Open existing access database with ADOX
oCn = Create("ADODB.Connection")
oCatSrc = Create("ADOX.Catalog")

oCn.Open("Provider=Microsoft.Jet.OLEDB.3.51;Data Source=D:\temp\db1.mdb;")
oCatSrc.ActiveConnection = oCn

*-- Create new Access database with ADOX
oCatNew = Create("ADOX.Catalog")
oCatNew.Create("Provider=Microsoft.Jet.OLEDB.3.51;Data Source=D:\temp\newdb.mdb;")

*-- Obtain reference to table in existing MDB
*-- and append it to the new MDB
oTbl = oCatSrc.Tables.Item("myTable")
oCatSrc.ActiveConnection.Close

oCatNew.Tables.Append(oTbl)
oCatNew.ActiveConnection.Close
Hope this helps,
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform