Solved

Using Access 2000 database with a database level password

Posted on 2002-03-05
5
241 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
  • 2
  • 2
5 Comments
 
LVL 100

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 100

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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. …
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

743 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now