Click to See Complete Forum and Search --> : Blackout... create database using ADO
Crazy D @ Work
October 28th, 1999, 10:28 AM
Hi
I'm having a blackout.. how do I create a database using ADO?
DAO is no problem but since I'm using ADO I'd like to use that... but I can't remember/can't find how to start...
Any idea where to start?
Tnx alot
Hope my brain is clear tomorrow.. probably not *LOL*
Crazy D @ Work :-)
Lothar Haensler
October 28th, 1999, 11:43 AM
you can't!
you need "Microsoft ADO Extensions for DDL and Security 2.1 (ADOX), " aka ADOX
(from MSDN).
Lothar Haensler
October 28th, 1999, 11:45 AM
BTW my previos post was from MS office 2000/ vb programmers guide...
Crazy D @ Work
October 29th, 1999, 02:53 AM
Good it wasn't me :-)
But I understand it's an extension from Access 2000.. so that means I can only create an Access2000 database with it? (not readable with Access95/97?)
Crazy D @ Work :-)
Lothar Haensler
October 29th, 1999, 03:00 AM
may I suggest that you try it?
just add a reference to "Microsoft ADO Ext 2.1 for DDL and Security" and (probably) use the Catalog.Create method...
let us know if it (doesn't) work(s)
Lothar Haensler
October 29th, 1999, 03:09 AM
hey, I tested it and surprise! it worked:
Private Sub Command1_Click()
Dim c As ADOX.Catalog
Set c = New ADOX.Catalog
c.Create "Provider=Microsoft.Jet.OLEDB.3.51;Data Source=m:\schrott\test2.mdb"
End Sub
I could open the MDB in Access 95!
Crazy D @ Work
October 29th, 1999, 03:12 AM
Hey that's neat, it solves a lot of problems :-)
Tnx man :-))
Crazy D @ Work :-)
Lothar Haensler
October 29th, 1999, 03:14 AM
>...solves a lot of problems.
...and probably creates a bunch of new problems?
e.g. when you use invalid parameters you get an error "there are several errors" (don't know how to translate my German error message into meaningful English). I haven't found a way to find out, WHAT errors occurred.
Crazy D @ Work
October 29th, 1999, 03:18 AM
hehe yeah probably, after all it's M$.. but I know those errors.. absolutely not-usefull :-) I've made enough workarounds for those errors though..
Crazy D @ Work :-)
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.