Showing results for 
Search instead for 
Did you mean: 

VS2008, VB2008, CR2008 - DB LogOn Question

Former Member
0 Kudos

The code below is my DB logon routine and works just fine.

Note - The reports were created with the CR10 designer, not sure if it makes a difference regarding my question below.

Currently, when integrated security is not used, the application provides the db id and password.

My question: Is there a way to use the id and password that's entered in the ODBC (Informix DB) so that the application does not have to provide the id and password?

Thank You!

Private Sub LogonToDB _

(ByVal server As String, ByVal database As String, _

ByVal id As String, ByVal password As String, ByVal integrated_security As Boolean, _

ByRef myReport As CrystalDecisions.CrystalReports.Engine.ReportDocument)

Dim logonInfo As New TableLogOnInfo()

Dim table As Table

For Each table In myReport.Database.Tables

logonInfo = table.LogOnInfo

logonInfo.ConnectionInfo.ServerName = server

logonInfo.ConnectionInfo.DatabaseName = database

If integrated_security = True Then

'needed for sql server

logonInfo.ConnectionInfo.IntegratedSecurity = integrated_security


logonInfo.ConnectionInfo.UserID = id

logonInfo.ConnectionInfo.Password = password

End If


Next table

End Sub

Edited by: Richard Eadie on Mar 2, 2011 4:54 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

My bad!!! The following does work -

logonInfo.ConnectionInfo.UserID = ""

logonInfo.ConnectionInfo.Password = ""

Answers (0)