PDA

Click to See Complete Forum and Search --> : creating a database at run time


Sep 29th, 1999, 09:38 PM
Is it possible to create a database at runtime I want to write a small app, that wiil need a new DB every year.
Maybe I could include a empty DB and use it as a template, making a copy of it every time a new DB is needed.

Any buddy got any advice??

Serge
Sep 29th, 1999, 10:37 PM
Using DAO is very easy to create a new empty database:

First, add a reference to Microsoft DAO library 3.x (select the highest version)

Then use this:


Dim db As Database

Set db = Workspaces(0).CreateDatabase("C:\MyDB.mdb", dbLangGeneral)


This will create an empty database, it means you have to create Tables (with fields in it) also.

Regards,

------------------

Serge

Software Developer
Serge_Dymkov@vertexinc.com
Access8484@aol.com