PDA

Click to See Complete Forum and Search --> : to call access2000 reports thro VB6 appliation..pls its bit urgent


deepakn
Nov 14th, 2000, 04:34 PM
Is it possible to access reports from access2000 to VB6 applications. I am trying to call the reports i have in my access 2000 database thro my vb application. I don't wanna use the crystal rpt or the data environment in my project. This is urgent request ..can any one help me /....

sweetgirl
Nov 14th, 2000, 09:01 PM
My friend had posted this question before. We got reply with codes below. Try it, it should work :

'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 actually opens your report from your Access
'db & print it..

End Sub

MSACCESS.CloseCurrentDatabase

Set MSACCESS = Nothing
'You need this,
'or you will keep access in memory & lag the user...

ScottF
Jan 12th, 2001, 08:17 PM
I was able to get vb to run report but I need to know the dll and exe file for setup. I using Access97