Hi,
I know how to create a database at runtime using DAO, But is it possible to create a MS ACCESS DATABASE without using DAO ?
If so how? :)
Thanks
Printable View
Hi,
I know how to create a database at runtime using DAO, But is it possible to create a MS ACCESS DATABASE without using DAO ?
If so how? :)
Thanks
Sure! use ADO
Add a reference to ADO 2.1 for DDL and Security, and have fun
<< Clunietp >> - I tried that but it doesn't seem to be working, what am I doing wrong?
here ya go!
Code:'uses ADO 2.x, ADO 2.x for DDL and security
Dim strConnectionStringOfNewDB As String
Dim objCat As ADOX.Catalog
'instantiate catalog object
Set objCat = New ADOX.Catalog
'connection string of new db -- includes driver/db type and location -- this will create Access 2000 database
strConnectionStringOfNewDB = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\NewDB.mdb"
'create it
objCat.Create strConnectionStringOfNewDB
'cleanup
Set objCat = Nothing