I need help on how i can switch between database servers using the same report. My application is developed using VB .Net 2003 Professional and SQL Server 2000.
My users data resides in tables with the same structure but on different servers. When a user logs in he/she selects the server machine on which to log on.
I used the following code but my problem is that the different logins still access the original data (on the machine which i used to design the report) despite the fact that the logon information has changed.
My code is as below:
Dim i As Integer
Dim logonInfo as new TableLogOnInfo()
Dim rptReport as new rptTransactions()
rptReport.Load()
For i = 0 To rptReport.Database.Tables.Count - 1
With logonInfo.ConnectionInfo
.ServerName = txtServerName.Text
.DatabaseName = txtDBName.Text
.UserID = txtUserID.Text
.Password = txtPWord.Text
End With
rptReport.Database.Tables.Item(i).ApplyLogOnInfo(logonInfo)
Next i
I am perplexed as to why the report does not go on to pick data to the server as per the above log on info!
Help needed urgently.
My users data resides in tables with the same structure but on different servers. When a user logs in he/she selects the server machine on which to log on.
I used the following code but my problem is that the different logins still access the original data (on the machine which i used to design the report) despite the fact that the logon information has changed.
My code is as below:
Dim i As Integer
Dim logonInfo as new TableLogOnInfo()
Dim rptReport as new rptTransactions()
rptReport.Load()
For i = 0 To rptReport.Database.Tables.Count - 1
With logonInfo.ConnectionInfo
.ServerName = txtServerName.Text
.DatabaseName = txtDBName.Text
.UserID = txtUserID.Text
.Password = txtPWord.Text
End With
rptReport.Database.Tables.Item(i).ApplyLogOnInfo(logonInfo)
Next i
I am perplexed as to why the report does not go on to pick data to the server as per the above log on info!
Help needed urgently.