Hi,
Im using visual studio 2013, Crystal version 13.0.12, SQL server 2014.
i have a 3 sql databases. each has the exact same structure in terms of tables and views etc.
DB1
DB2
DB3
I have created a report that connects via OLEDB to DB1.
At runtime, i want the report to point to either DB2 OR DB3 depending on the user profile or access i.e. the user can only view either DB1 or DB2. Each DB has company sensitive data so in no way must the user see any other DB data.
Each DB has its own sql user and password for login/read purposes.
i have tried the following...
Dim _rd As ReportDocument = New ReportDocument()
Dim reportPath As String = Server.MapPath(Request("Report"))
_rd.Load(reportPath)
_rd.DataSourceConnections.Clear()
Dim myConnectionInfo As ConnectionInfo = New ConnectionInfo()
Dim myTables As Tables = _rd.Database.Tables
For Each myTable As CrystalDecisions.CrystalReports.Engine.Table In myTables
Dim myTableLogonInfo As TableLogOnInfo = myTable.LogOnInfo
myConnectionInfo.ServerName = "MYSERVER"
myConnectionInfo.DatabaseName = "DB1"
myConnectionInfo.UserID = "USERDB1"
myConnectionInfo.Password = "PASSWORDDB1"
myTableLogonInfo.ConnectionInfo = myConnectionInfo
myTable.ApplyLogOnInfo(myTableLogonInfo)
Next
CrystalReportViewer1.ReportSource = _rd
the problem is that whenever i run the report it always prompts for database login???
server: correct.
user: incorrect
password: incorrect
Database: blank
i even tried to set the property "EnableDatabasePrompt" =False but it seems to be still looking...
how do i resolve???
thanks in advance
Anoop