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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal Reports with Access97 Password

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I am using Crystal Reports and Access97 in my VB6 application. The Access97 database is password protected and must remain so. How do I get CR to access the database without first prompting for the password ? The user's of my application must not, and do not need to know this password - the report must just display in the VB app as the password has already been passed to Access when the VB app was run.
Thank you and Regards
ChantelleB
 
This is some sample code - you can hardcode the UID and PWD values if you prefer.

For an SQL type database the following sample can be used. The variable values come from data entered into the text boxes by the user.

Code:
Private Sub Command1_Click(Index As Integer)
Dim UserID
Dim PassWD
Dim Server
Dim DSN1

UserID = Text2.Text
Server = Text1.Text
PassWD = Text3.Text
DSN1 = "Text4.Text"

  'simple password only connect

CrystalReport1.Connect = "PWD = " & PassWD & ""

  'connect with multiple variables

CrystalReport1.Connect = "UID = " & UserID & "" + ";" + "PWD = " & PassWD & ""

CrystalReport1.Connect = "DSN = " & DSN1 & "" + ";" + "UID = " & UserID & "" + ";" + "PWD = " & PassWD & ""

CrystalReport1.Action = 1

End Sub

[sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top