[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 148
  • Last Modified:

Accessing access reports from vb 6

I have another one for ya. I have a access 97 db that has a few reports that I would like to access from vb 6.0  How can this be done. I need this asap, so I will put out a handsome reward. Thanks
0
slimbx
Asked:
slimbx
  • 2
1 Solution
 
Éric MoreauSenior .Net ConsultantCommented:
Use this:

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
0
 
slimbxAuthor Commented:
Adjusted points from 150 to 200
0
 
slimbxAuthor Commented:
emoreau, I apologize for the wait. Here are the points that you deserve. Sorry and thanks again.
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now