Results 1 to 2 of 2

Thread: creating a database at run time

  1. #1
    Guest

    Post

    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??

  2. #2
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Post

    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
    [email protected]
    [email protected]



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width