Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ADOX and access databases
Message
From
12/11/2002 10:35:00
 
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00721347
Message ID:
00721608
Views:
8
>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,
Previous
Reply
Map
View

Click here to load this message in the networking platform