Skip to Content
0
Former Member
Jul 22, 2009 at 03:36 PM

VB .Net 2005/password protected Access 2007 database/Crystal Reports 10

113 Views

Hi,

I created a VB .Net 2005 application on a Vista machine that uses a password protected Access 2007 database and Crystal Reports 10. When trying to run Crystal reports through my application I keep getting prompted for a password by Crystal Reports. I am using the following code:

With crConnectionInfo

.ServerName = "C:\Program Files\Microsoft Visual Studio\VB_Net 2005\AUTO\Database\Auto.accdb"

.DatabaseName = "C:\Program Files\Microsoft Visual Studio\VB_Net 2005\AUTO\Database\Auto.accdb"

.UserID = "Admin"

.Password = ";"

End With

CrTables = Report.Database.Tables

For Each CrTable In CrTables

crtableLogoninfo = CrTable.LogOnInfo

crtableLogoninfo.ConnectionInfo = crConnectionInfo

CrTable.ApplyLogOnInfo(crtableLogoninfo)

Next

I know that I am suppose to use the following as I have done in the rest of my application, but don't know how to code this so the logon info gets to Crystal Reports:

Conn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Microsoft Visual Studio\VB_Net _

2005\AUTO\Database\Auto.accdb"

Conn.Open()

I have done extensive Google searches and tried different variations of .ServerName and .DatabaseName using 'Provider=Microsoft.ACE.OLEDB.12.0;... along with the password but nothing is working. I keep getting prompted for the password.

Any help would be greatly appreciated.

Thanks