Ed James
12-07-2000, 03:22 PM
From VB, I'm trying to run an Access report contained in an Access db which is passworded. I have done this for a non passworded db as follows:
Set appAccess = New Access.Application
appAccess.Visible = False
appAccess.OpenCurrentDatabase strDB
appAccess.DoCmd.OpenReport strReportName,acViewPreview
The OpenCurrentDatabase doesn't take a password as an argument and an Application object is needed to get at DoCmd which is needed to call OpenReport.
Alternatively something like the following will return a db object opened with a specified password.
Set dbs = appAccess.DBEngine.Workspaces(0).OpenDatabase("C:\Access.mdb", False, False, ";pwd=blaaa")
Does anyone know how to combine the OpenDatabase method (which copes with a password) with the need to get at the DoCmd in order to run a report ? Any other suggections ?
Set appAccess = New Access.Application
appAccess.Visible = False
appAccess.OpenCurrentDatabase strDB
appAccess.DoCmd.OpenReport strReportName,acViewPreview
The OpenCurrentDatabase doesn't take a password as an argument and an Application object is needed to get at DoCmd which is needed to call OpenReport.
Alternatively something like the following will return a db object opened with a specified password.
Set dbs = appAccess.DBEngine.Workspaces(0).OpenDatabase("C:\Access.mdb", False, False, ";pwd=blaaa")
Does anyone know how to combine the OpenDatabase method (which copes with a password) with the need to get at the DoCmd in order to run a report ? Any other suggections ?