Crystal Reports 2008 ver. 12.0.0.683(sp0)
Visual studio 2005 (vb)
SQL2005z & Oracle (db)
The problem is that when the following line is executed, the database name and all information reverts back to the original information (database name,etc) . (when i try to change connection SQL to Oracle db, and Oracle to SQL).
crTable.ApplyLogOnInfo(crTableLogOnInfo)
Code:
Dim crTableLogOnInfo As New TableLogOnInfo
Dim crConnectionInfo As CrystalDecisions.Shared.ConnectionInfo = New
CrystalDecisions.Shared.ConnectionInfo()
...
With crConnectionInfo
Select Case intProvider
Case databaseProvider.sqlServer
.ServerName = "server"
.DatabaseName = "DB"
.UserID = "sa"
.Password = ""
Case databaseProvider.Oracle
.LogonProperties.Clear()
.Attributes.Collection.Clear()
'setup the attributes for the connection
dbAttributes.Collection.Set("Server", "ORCL")
dbAttributes.Collection.Set("Trusted_Connection", False)
.ServerName = "ORCL"
.DatabaseName = ""
.UserID = "us"
.Password = "pwd"
.Attributes.Collection.Set("Database DLL", "crdb_oracle.dll")
.Attributes.Collection.Set("QE_DatabaseName", "")
'.Attributes.Collection.Set("QE_DatabaseType", "Servidor de Oracle")
.Attributes.Collection.Set("QE_SQLDB", True)
.Attributes.Collection.Set("SSO Enabled", False)
.Attributes.Collection.Set("QE_LogonProperties", dbAttributes)
.LogonProperties = dbAttributes.Collection
.Type = CrystalDecisions.Shared.ConnectionInfoType.CRQE
End Select
End With
...
..
*For Each crTable In crTables
crTableLogOnInfo = crTable.LogOnInfo
crTableLogOnInfo.ConnectionInfo = crConnectionInfo
crTable.ApplyLogOnInfo(crTableLogOnInfo)
next*
Don't return error, ApplyLogOnInfo.
Regards