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!

Cannot retreieve records from MS ACCESS Dbase with Password

Status
Not open for further replies.

antonio26

Technical User
Joined
Jun 18, 2004
Messages
3
Location
US
Hi guys, i have this typical ways of accessing my records from a database but it seems that it doesnt work. I'm always getting an error "database session failed". When I tried this code of retrieving data with any MS ACCESS Database without password, It works though.. but with password, I keep on getting that error.. Can some help me please??
-----------------------------

Dim Report As New CrystalReport1

Private Sub Form_Load()
Screen.MousePointer = vbHourglass
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
Screen.MousePointer = vbDefault

End Sub

 
Look up the help topic on .SetSessionInfo

In Microsoft Access 95 and later, an Access database can have session security (also known as user-level security), database-level security, or both. If the Access database contains only session security, simply pass the session password to the SessionPassword parameter. If the Access database contains database-level security, use a linefeed character, Chr(10), followed by the database-level password. For example:

object.SetSessionInfo "userID", Chr(10) & "dbpassword"

If the Access database contains both session security and database-level security, use the session password followed by the linefeed character and the database password.

object.SetSessionInfo "userID", _
"sesspswd" & Chr(10) & "dbpassword"
 
Balves,

I just want to say Thannnnnnnkkkkkkkk youuuuuu so so so much.... you know what? the .Setsession is the only command that I need to break the password thing...

Again, thanks a lot, I really appreciate it. My program now works really good.

God Bless
-Antonio
 
I am writing a small human resources program for a company who is too cheap to buy later version software, so created the program with VB6, Access97, and Crystal 4.5 (whew). The problem I had was at the end when I encrypted the Access database and set a database level password (using the network for user access, so only a database password needed) to protect the data from users who (may) go astray and try to steal the data.
The problem was in Crystal Reports, as when I went to print a report, I was given an 'Access Input Box for a Password', which if given the database level password it worked fine. The problem is the same users who would have to provide the password are the ones the data is being protected from, so I wanted Crystal to open the database using an internal password. After checking through all of the help files, all of the Crystal Report Technical papers, and at least a dozen other sites, nothing. When I got here, I saw what was happening with version 8.0, and decided to try every combination of settings for the Crystal Reports 4.5 Active X object and when I included (where xxx is a user defined data structure and password is a string * 30 member variable)...

crystalreport1.password = chr(10) & xxx.password

, it worked. Thanks balves for pointing me to the linefeed. This was really a pain, and if you figured this out on your own, your prob a genius (or close). Thanks Again. Rick

 
Oops, make that

crystalreport1.password = "" & Chr(10) & trim(xxx.password)

Thanks, Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top