Click to See Complete Forum and Search --> : Creating A Database at Runtime ??
omarswan
Mar 8th, 2000, 06:26 PM
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
Clunietp
Mar 8th, 2000, 10:42 PM
Sure! use ADO
Add a reference to ADO 2.1 for DDL and Security, and have fun
omarswan
Mar 9th, 2000, 03:41 AM
<< Clunietp >> - I tried that but it doesn't seem to be working, what am I doing wrong?
Clunietp
Mar 9th, 2000, 10:00 AM
here ya go!
'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
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.