、多分あなたは、いくつかのアイデアを得ることができます:実験の
For Each tmpTable In Report.Database.Tables
Set CPProperties = tmpTable.ConnectionProperties
CPProperties.DeleteAll
CPProperties.Add "Provider", "SQLOLEDB"
CPProperties.Add "Data Source", mServerName
CPProperties.Add "Initial Catalog", mBaseName
CPProperties.Add "User ID", mUserID
CPProperties.Add "Password", mPassword
CPProperties.Add "Server Name", mServerName
CPProperties.Add "Server Type", "OLEDB"
CPProperties.Add "DataBase", mBaseName
tmpTable.SetTableLocation tmpTable.Location, "", ""
Next tmpTable
For Each tmpSection In Report.Sections
For Each tmpObject In tmpSection.ReportObjects
If TypeName(tmpObject) = "ISubreportObject" Then
Set tmpReport = tmpObject.OpenSubreport()
For Each tmpTable In tmpReport.Database.Tables
Set CPProperties = tmpTable.ConnectionProperties
CPProperties.DeleteAll
CPProperties.Add "Provider", "SQLOLEDB"
CPProperties.Add "Data Source", mServerName
CPProperties.Add "Initial Catalog", mBaseName
CPProperties.Add "User ID", mUserID
CPProperties.Add "Password", mPassword
CPProperties.Add "Server Name", mServerName
CPProperties.Add "Server Type", "OLEDB"
CPProperties.Add "DataBase", mBaseName
tmpTable.SetTableLocation tmpTable.Location, "", ""
Next tmpTable
End If
Next tmpObject
Next tmpSection
あなたは幸運です;) – dotjoe