|
-
Aug 9th, 2000, 11:55 PM
#1
Thread Starter
Member
My database is in Access, so can my vb program call an Access report??????? If it's possible, how is it done? Someone help me purrleease..........
-
Aug 10th, 2000, 01:30 AM
#2
Lively Member
If you want to print a report created in MS Access
using your VB application, then its your lucky day.
I've got this in this forum... but forgot the thread no.
or the person who send it. Many of us tried this... and
this really work. here's the code:
' From the book Database Access With VB6
' by Jeffery Mcmanus..
' you need your access ref obj lib
Dim MSACCESS as Access.application
Private Sub PrintReport_Click()
Set MSACCESS = New Access.Application
MSACCESS.OpenCurrentDatabase ("c:\your dir\Your.mdb")
'This opens your db..
MSACCESS.DoCmd.OpenReport "YourReportHere", acViewNormal
'This actualy opens your report from your Access (97?)
'db & then prints it..
MSACCESS.CloseCurrentDatabase ' self explanitory
Set MSACCESS = Nothing
' You need this,
' or you will keep access in memory & lag the user..
-
Aug 10th, 2000, 02:56 AM
#3
The above only works if the machine the program is running on has Access installed, if that matters to you.
-
Aug 10th, 2000, 03:15 AM
#4
Thread Starter
Member
thanks a million rod for the codes. u too edneeis.
yup... there's access installed in the machine. But just for curiosity, what if access resides in the server???
-
Aug 10th, 2000, 11:51 AM
#5
Lively Member
You can create the object on the server by using the CreateObject function.
CreateObject(class,[servername])
MSDN -- CreateObject Function:
http://msdn.microsoft.com/library/de...eateObject.htm
-
Aug 10th, 2000, 01:25 PM
#6
Member
If you don't have Access installed on the target machine, you can use a product from Videosoft called VS Reports
It is an add in OCX control that lets you distribute an app with Access reports to clients who don't have Access installed...
It works pretty well on the one app I have tried it on here at work.
~Michael Kizer
http://Michael.Kizer.ws
The Ivory Gate Of Dreams ~ http://www.ivorygate.com
-
Aug 10th, 2000, 01:43 PM
#7
Why not VB reports?
Liz, why didn't you just use the reporting capability of VB?
Another neat trick is to report the data in HTML format. That way the results could be posted to a shared drive for all (at least those with a browser and access to the drive) to see. That could save a lot of trees from being sacrificed to the report gods.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|