PDA

Click to See Complete Forum and Search --> : MS Access DB Pswd + Crystal Reports + Visual Studio .NET


stewarts
Feb 16th, 2006, 02:49 PM
Does anyone know if it's possible to pass the password for a password-secured MS Access db through the connect string or through code? I have a vb.net windows app that had a working crystal report that connected to the ms access db. I had to password-secure the database and now the crystal reports can't get to the database. Now matter how I attempt to send the password info through the connection ifo, I keep getting a login screen (which I do not want to appear), but even if I enter the password in the logon screen, the login fails every time. Thanks for any assistance.
P.S. I read somewhere that "you cannot set a database level password when using Crystal Reports for Visual Studio .NET 2002 or 2003"...anyone know if this is true?

Here is the code where I tried to pass the password:

Dim crReportDocument As New ReportDocument
Dim crConnectionInfo As New ConnectionInfo
Dim crtableLogoninfo As New TableLogOnInfo
Dim crTables As Tables
Dim crTable As Table

crReportDocument = New AccreditationRpt1
With crConnectionInfo
.Password = Chr(10) + "password"
End With
crTables = crReportDocument.Database.Tables
For Each crTable In crTables
crtableLogoninfo.ConnectionInfo = crConnectionInfo
crTable.ApplyLogOnInfo(crtableLogoninfo)
Next
CrystalReportViewer1.ReportSource = crReportDocument