Creating a database in Access programatically

As far as I know its impossible to create an mdb file programatically (except you have access to another Access database and create it from there).

So the question is, if Access will be installed on the target machines where your application runs. But no difference if or if not, in this case I would distribute an empty mdb file and start with my application from that point. So you will be on the safe side and your application is independent from the existence of Access on these machines.

Another consideration, depending on the location of the database and the number of users accessing it, was eventually the usage of SQL Server 2000, or if cost matters (and if there are not too many users concurring one another), his little brother MSDE.
 
Despite most developers think MS Access engine isnt worth even a look, theyre wrong.
For most small and mid apps, and access db would do just fine. Less resouce consumer, pretty fast for most of requirements... and so forth.

Now for the question.
I believe you can do that if you use ADO 2.7 (not ADO .net).

Alex :p
 
AlexCode said:
I believe you can do that if you use ADO 2.7 (not ADO .net).
I would say, ADO has nothing in common with a specific database model. So it doesnt know anything about the binary format of a mdb file or any other database format and you cant generate a mdb file out of the box.
 
AlexCode said:
Take a look at the ADOX dll...
And here we go. Alex is right and Im a bit rusty with Access. :-\
Code:
Dim constr As String = "provider=microsoft.jet.oledb.4.0;data source=c:\\adoxtest.mdb"
Dim cat As New ADOX.Catalog
cat.Create(constr)
You have to reference msadox.dll (Microsoft ADO ext. 2.x ...). You find it among the COM components.
 
Back
Top