PDA

Click to See Complete Forum and Search --> : Password Prompt Problem


Rob Brown
May 25th, 2000, 06:15 PM
Hi,

I'm trying to print an access report using a menu item in vb with the following code:

Public Sub Print_Report()

Dim AccessApp As Access.Application

Set AccessApp = New Access.Application
AccessApp.OpenCurrentDatabase "D:\Databases\Serck Incident Database\sid.mdb"
AccessApp.DoCmd.OpenReport "rptReport", , , "[Ref]=#" & cboIncidentList & "#"

End Sub

The code works OK but the application prompts for a user name and password. I don't want this to happen.

Any ideas?

Best Regards,

Rob Brown.

JHausmann
May 26th, 2000, 03:02 AM
Throw in the following before you run the command:

AccessApp.DBEngine.DefaultUser="UserID"
AccessApp.DBEngine.DefaultPassword="PasswordforaboveUser"