Password in Crystal Report ,
Posted on 2002-03-30
I am using Visual Basic , Crystal Report 4.6 and MS Access 97 . Now I have designed a Report using Crystal report 4.6 . The Database is in MS Access and the Database is password Protected .
I am using the following code to Display the Report .
CR1.ReportFileName = App.path & "\pur.rpt"
CR1.DataFiles(0) = App.path & "\Inventory.mdb"
CR1.Password = "password"
CR1.Destination = crptToWindow
CR1.Action = crRunReport
So when I execute this code the Crystal Report asks for password . So what should I do in order to the have the password coded in the programe so that user is not disturbed.
My connection to Access is as follows
Set conn = New Connection
Dim path As String
path = "D:\Inventory2\Inventory.mdb"
Set res = New Recordset
Set comm = New Command
str = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source= " & path & ";" & _
"Jet OLEDB:Database Password=password;"