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?
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
Edited by: Richard Eadie on Mar 2, 2011 4:54 PM