|
-
Nov 20th, 2003, 03:05 PM
#1
Thread Starter
Hyperactive Member
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)
-
Nov 20th, 2003, 03:26 PM
#2
Hyperactive Member
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.
-
Nov 20th, 2003, 03:29 PM
#3
Maybe:
VB Code:
DBEngine.SystemDB = App.Path + "\database\Mfguser.mdw"
Set ws = [b]DBEngine[/b].CreateWorkspace("", "dn8tj3o2p5k0gls32ws4", "gia3sejt8lztek")
freshDBName = App.Path + "\database\mydb.mdb"
Set freshDB = [b]ws[/b].OpenDatabase(freshDBName)
Bruce.
-
Nov 20th, 2003, 03:32 PM
#4
Thread Starter
Hyperactive Member
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.
-
Nov 20th, 2003, 03:44 PM
#5
Hyperactive Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|