Results 1 to 5 of 5

Thread: can not open database

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2002
    Posts
    471

    can not open database

    Can somebody tell what I am doing wrong here, I got error"type mismatch" when the running reach the last line.



    Global ws As Workspace
    Global freshDB As Database
    Global freshDBName As String


    DBEngine.SystemDB = App.path + "\database\Mfguser.mdw"
    Set ws = CreateWorkspace("", "dn8tj3o2p5k0gls32ws4", "gia3sejt8lztek")

    freshDBName = App.path + "\database\mydb.mdb"
    Set freshDB = DBEngine.OpenDatabase(freshDBName)

  2. #2
    Hyperactive Member
    Join Date
    Sep 2001
    Location
    San Jose, Ca. - USA
    Posts
    302
    first guess is that your trying to connect to a access 2000, 2002 or 2003 mdb file.

    if this is true then your problem is probably that you have a reference to dao3.51 or below in your vb project. When connecting to a access 2000, 2002 or 2003 mdb file you need to reference dao3.60

    you can get dao3.60 by installing vb service pack 5.

  3. #3
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429
    Maybe:
    VB Code:
    1. DBEngine.SystemDB = App.Path + "\database\Mfguser.mdw"
    2. Set ws = [b]DBEngine[/b].CreateWorkspace("", "dn8tj3o2p5k0gls32ws4", "gia3sejt8lztek")
    3.  
    4. freshDBName = App.Path + "\database\mydb.mdb"
    5. Set freshDB = [b]ws[/b].OpenDatabase(freshDBName)




    Bruce.

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2002
    Posts
    471
    Actually my db is Access7, and I use dao350.

    Well, the whole story is like this: the program run perfectly before I made the reference change from dao350 to dao360. I found dao360 would not work and tried to change it back to dao350, then the error happened.

  5. #5
    Hyperactive Member
    Join Date
    Sep 2001
    Location
    San Jose, Ca. - USA
    Posts
    302
    actually dao360 is backward compatible with dao3.51 and below so you should still be able to do every you use to.

    do you by any chance have a refernce to ado in your project? if you do then you would need to change

    Global freshDB As Database

    to

    Global freshDB As DAO.Database

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