Solved

Using Access 2000 database with a database level password

Posted on 2002-03-05
5
245 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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. …
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

863 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

24 Experts available now in Live!

Get 1:1 Help Now