Results 1 to 4 of 4

Thread: Creating A Database at Runtime ??

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 1999
    Location
    NY, USA.
    Posts
    240

    Post

    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
    Omar
    [email protected]
    http://omar.caribwalk.com
    To God Be The Glory

    I see Tech People ...

  2. #2
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    Sure! use ADO

    Add a reference to ADO 2.1 for DDL and Security, and have fun

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Oct 1999
    Location
    NY, USA.
    Posts
    240

    Post

    << Clunietp >> - I tried that but it doesn't seem to be working, what am I doing wrong?
    Omar
    [email protected]
    http://omar.caribwalk.com
    To God Be The Glory

    I see Tech People ...

  4. #4
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    here ya go!

    Code:
    '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

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