Hi Allan.
You can use this code:
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
>Hi,
>
>I'm (reluctantly) working on an VB6 app that uses an Access 97 (ugh - not my choice) database. Can I develop some reports in Access 97 - and run these reports from VB6 (assuming, of course, that the user has the Access runtime on their P.C.)?
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com