cancel
Showing results for 
Search instead for 
Did you mean: 

CR poor implementation on password protected ACCESS database

Former Member
0 Kudos

<p>Hi everybody,</p><p>&nbsp;</p><p>i am struggling to connect CR for .NET to a password-protected ACCESS database at runtime in VB.NET. I read most of the documentation covering this subject. The infamous knowledge base <span style="margin-left: 5px">article "c2010460</span> " says that this can be possible via "convert the native connection to an ODBC or OLE DB connection which supports Access session security" but there is no explanation on how to do that.</p><p>&nbsp;</p><p>If this issue is also in CR Developer Edition, i am not happy on spending hundreds of dollars for not having fixed such a simple task. I don&#39;t get it why this is not yet properly implemented.</p><p>&nbsp;</p><p>Me! </p>

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi, Adrian;

To convert from the native driver to OLE DB or ODBC, do the following:

- Open the report in the .NET IDE

- Right click a blank section of the report and choose Database -> Set Location

- In the Replace With box, choose either OLE DB or ODBC, and go through the steps to make the connection.

- Back in the Set Location box, in the Current Data Source, make sure the Table is selected, and then select the same table in the Replace With box from the new connection you made.

- Click the Replace button, and the report should be converted to the new driver.

The following Visual Basic.NET sample code demonstrates how to access a password protected Ms-Access database programmatically.

-


Imports CrystalDecisions.CrystalReports.Engine

Imports CrystalDecisions.Shared

Public Class Form1

Inherits System.Windows.Forms.Form

Dim report As New SampleReport

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

ConfigureCrystalReports()

End Sub

Private Sub ConfigureCrystalReports()

Dim crConnectionInfo As ConnectionInfo = New ConnectionInfo

crConnectionInfo.ServerName = (Application.StartupPath & "\Sample.mdb")

crConnectionInfo.Password = "TEST"

setDBLogonForReport(crConnectionInfo, report)

CrystalReportViewer1.ReportSource = report

End Sub

Private Sub setDBLogonForReport(ByVal connection As ConnectionInfo, ByVal report As ReportDocument)

Dim mytables As Tables = report.Database.Tables

Dim mytable As CrystalDecisions.CrystalReports.Engine.Table

For Each mytable In mytables

Dim mytablelogoninfo As TableLogOnInfo = mytable.LogOnInfo

mytablelogoninfo.ConnectionInfo = connection

mytable.ApplyLogOnInfo(mytablelogoninfo)

Next

End Sub

End Class

Cheers,

Jonathan

Former Member
0 Kudos

It is great, Jonathan, that your example handles logon with a user name and user password. But MS Access has another level of protection. This level is the database password level. At this level all you need is a password without a user name.

Do you have an idea of how to logon as in your example, with 1. database password, and then 2. user ID and User password

many Thanks

NickO

former_member183750
Active Contributor
0 Kudos

ignore this message

Edited by: Ludek Uher on Aug 1, 2008 6:32 PM