The following function gives the error ” type mismatch” :
Public Function Dummy()
Dim bappath As String
Dim sappath As String
Dim appath As String
Dim db As DAO.Database
Dim ws As DAO.Workspace
Set ws = DBEngine.Workspaces(0)
Dim PWD As String
PWD = ” password”
bappath = “C:BEUni.mdb”
sappath = “C:BELewi.mdb”
appath = bappath Or sappath
Set dbs = wsp.OpenDatabase(appath, , , “PWD=” & strpassword)
End Function
WHat i wanted to do is the following. The function looks up for given databases, amd if it finds one, for example bappath, to open it with the common name appath.
appath must be either bappath or sappath,depending on the availability.
If bappath is present, then appath = bappath, if sappath is present, then appath = sappath.
Can somebody help me ?