Solved

Access database through VB6

Posted on 2003-10-27
3
167 Views
Last Modified: 2010-05-03
I have a VB6 application that I would like to have the ability to open and view an Access database report and print it.  Is there a way to do that?

0
Comment
Question by:sjmmajor
3 Comments
 
LVL 7

Accepted Solution

by:
_agj_ earned 250 total points
ID: 9626258
Set a reference to teh MS Access library in references:

sub makeRPT()

Dim acApp As Access.Application
Dim rpt As Access.Report

acApp.OpenCurrentDatabase "DBPath"     'path of db to open
Set rpt = acApp.CreateReport(acApp.CurrentDb, ReportTemplate)    'ReportTemplate is name of rreport tmplate.

rpt.Print

end sub
0
 

Author Comment

by:sjmmajor
ID: 9626404
Does the person have to have access.exe on their computer?
0
 
LVL 4

Expert Comment

by:JNSTAUB
ID: 9626775
no , you may use ADO and cristal report without access on the client computer, a lot of dll will be  provide with the package that you will create.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

813 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now