Solved

Using Access 2000 database with a database level password

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
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…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

856 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