Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Accessing access reports from vb 6

Posted on 2000-03-29
3
Medium Priority
?
147 Views
Last Modified: 2010-05-02
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
Comment
Question by:slimbx
  • 2
3 Comments
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 800 total points
ID: 2669261
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
 

Author Comment

by:slimbx
ID: 2696484
Adjusted points from 150 to 200
0
 

Author Comment

by:slimbx
ID: 2696485
emoreau, I apologize for the wait. Here are the points that you deserve. Sorry and thanks again.
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question