Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create database from VB with ADO

Status
Not open for further replies.

Weebairnes

Programmer
Dec 23, 2003
25
US
I am working to convert a db from DAO to ADO...

How do I make a database with some ADO method?
If I understand correctly, I have two options for making a database.

Dim cat As New ADOX.Catalog
cat.Create "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=.\New.mdb;"

OR

Dim appAccess As Access.Application
Set appAccess = CreateObject("Access.Application.9")
appAccess.NewCurrentDatabase "C:\My Documents\Newdb.mdb"

Situation:
I have a audit trail table that grows quickly. So, after so many thousands of records, the code exports this table it to a 'backup' database and cleans out the current audit trail record. All that works peachy. In the event that the backup database isn't present - I need to create it. That's my goal: simply create a new db with ADO. Then the code will export the table.

1) Is one method better than the other?
2) I don't understand the parameters in the cat.Create method. In fact, I don't know what DLL to use in the references so that my DB recognizes the statement
Dim Cat As New ADOX.Catalog
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top