Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Retrieve records from MSACESS dbase with password

Status
Not open for further replies.

antonio26

Technical User
Joined
Jun 18, 2004
Messages
3
Location
US
Hello guys,

Im trying to retrieve some records from MS ACCESS dbase with password in my VB Codes but I keep on getting this error "Open database session failed", If I try to unset the password of that dbase, it does work... however, I really need to set the password for security reason. I have this typical code of the CRViewer though.

---------------------------------------
Screen.MousePointer = vbHourglass
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
Screen.MousePointer = vbDefault
---------------------------------------

 
Here is a section of code that you can use. I usually insert between the two CRViewer... code lines

CRViewer1.ReportSource = Report

Report.Database.Tables.Item(1).SetLogOnInfo "servername_here", "databasename_here", "login", "password"

CRViewer1.ViewReport

The inserted code should be all on one line
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top