Set Datasource Location across multiple Databases
- From: jcantwell@xxxxxxxxxxxxxxxxxxxxxxx
- Date: 12 Jan 2007 07:40:21 -0800
I have reports that when originally created were based on many tables
in 1 database. We receintly started archiving some of the tables
needed in the reports. If I would like to keep versions of the reports
for each archived DB then I would just us the Set Datasource Location
and recreate the reports but I need to be able to do this on the fly.
Below is the code that I am using. I do the same for all tables in the
subreports and I get connectivity on all tables and no errors thrown
but the report prints blank.
If anyone has any ideas it would be much appreciated
For Each cTable In rpt.Database.Tables
If changeDB Then
myTableName = UCASE(cTable.Name)
If myTableName = "MASTER" Or myTableName = "RESULTS" Or
myTableName = "SUBRESULTS" Then
myServerName = data(8)
myDatabaseName = data(9)
Else
myServerName = "SQLMain"
myDatabaseName = "Maindata"
End If
Else
myServerName = cTable.LogOnServerName
myDatabaseName = cTable.LogOnDatabaseName
End If
cTable.SetLogOnInfo myServerName, myDatabaseName, "xxxxx",
"xxxxx"
If cTable.TestConnectivity Then
MsgBox myTableName & " connected"
Else
MsgBox myTableName & " NOT connected"
End If
Next
TIA,
Jac
.
- Prev by Date: Re: Amount to text
- Next by Date: Printing drill down report
- Previous by thread: Set Hyperlink on record in subreport and after clicking on it redirect to specified subreport
- Next by thread: Printing drill down report
- Index(es):