Solved

Using Access 2000 database with a database level password

Posted on 2002-03-05
5
261 Views
Last Modified: 2012-06-27
I have an Access 2000 database with a database level password.  I have written an VB 6.0 application which uses the Crystal Reports 7.0 Object Model.  Without the password everything works great, using the preview method of the report object.  When I added the database level password, I am now getting a database parameter error.  

1. How do I set the database level password in code?
(remember I am using the CR Object Model: an example is I am setting the database location through the location property of the database object).  
2. Why is the documentation in Crystal so bad?  I am new to Crystal Reports and Version 7 is what my company is using (they prefer to use Actuate as their enterprise reporting tool).

Thanks.

BK
0
Comment
Question by:bknouse
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 101

Expert Comment

by:mlmcc
ID: 6844592
What code are you using to access the report?  

Is the data passed to the report from VB or is the query set in the CR design?

You may have to add the password to the CR through the designer and the database connection.

mlmcc
0
 
LVL 6

Author Comment

by:bknouse
ID: 6844789
Thanks for responding.

What code are you using to access the report?  

I have set a reference to Crystal Reports in VB.  (I am not using the ActiveX control).  I then declare several variables of different Crystal Report types (Report, Database, etc.).  Since the database can be loaded anywhere by the user (C drive, D drive, Folder X, Folder Y), I am setting the database and database location in code (from examples in Crystal).  I guess the question is, How do I set the Database Password in code?  Let me mention, I have no trouble in the CR design environment, as it asks for the database password.

Is the data passed to the report from VB or is the query set in the CR design?

The data source is set in CR, which is based on a query in Access 2000.  There are also 2 subreports which also have data sources based on queries in Access.

You may have to add the password to the CR through the designer and the database connection.

I have a connection object in VB which opens correctly with the addition of "Jet OLEDB:Database Password = MyPass" in the connection string.  

I was continuing to review other sources and came across the SetSessionInfo method.  What is this?  Is this where I would pass CR the database password?

Thanks.

BK

0
 
LVL 101

Expert Comment

by:mlmcc
ID: 6846264
I don't know what SETSESSIONINFO does.

I'll look into how to pass the password tomorrow.

mlmcc
0
 
LVL 1

Accepted Solution

by:
kzbera earned 100 total points
ID: 6846509
Why are you so angry with crystal help. Try this one


Actually 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"


Hope this will solve your problem.
Best of luck
0
 
LVL 6

Author Comment

by:bknouse
ID: 6847109
Actually I got this before your answer (same solution) as suggested in my post.  The only problem was knowing it is the SetSessionInfo to find it in the help file.  Plus, what a strange construct with the linefeed between the User specific logon info and the database password.  But it works, I am happy and the users are happy.  But I still think CR has bad help.  Where's a graphic showing the complete API Object model?  This would greatly help in seeing how the CR objects interact with one another.

BK
0

Featured Post

Enroll in July's Course of the Month

July's Course of the Month is now available! Enroll to learn HTML5 and prepare for certification. It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question