Results 1 to 3 of 3

Thread: How do I create a DB file with the *.mdb extension

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 1999
    Location
    Leeds, UK
    Posts
    287

    Question

    Hi,

    I would like to create a DAO DB file with the *.mdb extension. I tried this code but it didn't work:

    Dim db As DataBase
    Set db = CreateDataBase("C:|Db.mdb")

    Could somebody please help me? Thanks!
    rino_2
    Visual Basic, HTML
    Please Visit my Site: Richard's VB Site

  2. #2
    Fanatic Member Gary.Lowe's Avatar
    Join Date
    May 2000
    Location
    In my sphere of influence
    Posts
    621
    Rino

    try this
    Code:
            Dim wrkDefault As Workspace
    	Dim dbsNew As DATABASE
    
    	' Get default Workspace.
    	Set wrkDefault = DBEngine.Workspaces(0)
    
    	' Kill the database if it already exists 
    	If Dir("NewDB.mdb") <> "" Then Kill "NewDB.mdb"
    
    	' Create a new database
    	Set dbsNew = wrkDefault.CreateDatabase("NewDB.mdb", dbLangGeneral)
    this should work

    Gazza

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 1999
    Location
    Leeds, UK
    Posts
    287

    Smile

    Thanks for the help!
    rino_2
    Visual Basic, HTML
    Please Visit my Site: Richard's VB Site

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