Link to home
Start Free TrialLog in
Avatar of kenspencer
kenspencer

asked on

Using VB6 to Open Access 2000 Report

Does this technique (obtained from another EE question)

-------------------------------------------------------------------------------
Const dbPathName = "c:\database.mdb"
Const strPassword = "PASSWORD"
Dim Acc As Object, db As Object

Set Acc = CreateObject("Access.Application")
Set db = Acc.Application.DBEngine.Workspaces(0).OpenDatabase(dbPathName, 0, False, ";pwd=" & strPassword)
Acc.OpenCurrentDatabase dbPathName, False
Set db = Nothing
Acc.DoCmd.OpenReport "ReportName", acPreview
Set Acc = Nothing
------------------------------------------------------------------------------

work if the target machine only has the VB app and the .mdb file installed (MS Office may not be installed or the same version of Access)?  Any change if the .mdb is a .mde instead?  This is being programmed in VB6 & Access 2000.

Thanks.

Ken
Avatar of Sethi
Sethi
Flag of India image

Interesting...
Avatar of Éric Moreau
one thing for sure is that it won't work without Access properly installed.
Avatar of kenspencer
kenspencer

ASKER

emoreau,

Does your comment mean that a compiled and installed VB program would not have the necessary DLLs to open a stand-alone .mdb?

Ken
ASKER CERTIFIED SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Anything else, anybody?  If not, I will award emoreau the points.

Ken
Sigh ... guess it's back to Crystal Reports.