I have to print a report created in MS-Access 97 from a VB application.
I have tried the following code:
Private Sub cmdRapport_Click()
Dim objAccess As Access.Application
Set objAccess = New Access.Application
With objAccess
.OpenCurrentDatabase "C:\toto.mdb"
.DoCmd.OpenReport "Rapport1"
.Quit acQuitSaveNone
End With
Set objAccess = Nothing
End Sub
Now, I have my report printed BUT my database is protected by a password. When I execute the OpenCurrentDatabase method, a dialog box ask the password to the user.
How can I pass the password using this method OR how can I print a report from a database object?
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com