Using VB6 to Open Access 2000 Report

kenspencer
kenspencer used Ask the Experts™
on
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
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
Interesting...
Éric MoreauSenior .Net Consultant
Top Expert 2016

Commented:
one thing for sure is that it won't work without Access properly installed.

Author

Commented:
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
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Senior .Net Consultant
Top Expert 2016
Commented:
You cannot distribute Access DLLs. You don't have the rights to do it. You must require the user to already have it properly installed.

Author

Commented:
Anything else, anybody?  If not, I will award emoreau the points.

Ken

Author

Commented:
Sigh ... guess it's back to Crystal Reports.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial