For Each Sect In oRpt.Sections
For Each RptObject In Sect.ReportObjects
If RptObject.kind = 5 Then
Set subrpt = RptObject
Set subrpt1 = subrpt.OpenSubReport()
Set db = subrpt1.Database
Set dbtables = db.Tables
For i = 1 To dbtables.Count
Set dbtable = dbtables.Item(i)
dbtable.SetLogOnInfo CStr(odbc_name), CStr(base_name), "sa", CStr(oldpwd))
Set dbtable = Nothing
Next
Set dbtables = Nothing
Set db = Nothing
Set subrpt1 = Nothing
Set subrpt = Nothing
End If
Next
Next
Set Sect = Nothing
For Each RptObject In Sect.ReportObjects
If RptObject.kind = 5 Then
Set subrpt = RptObject
Set subrpt1 = subrpt.OpenSubReport()
Set db = subrpt1.Database
Set dbtables = db.Tables
For i = 1 To dbtables.Count
Set dbtable = dbtables.Item(i)
dbtable.SetLogOnInfo CStr(odbc_name), CStr(base_name), "sa", CStr(oldpwd))
Set dbtable = Nothing
Next
Set dbtables = Nothing
Set db = Nothing
Set subrpt1 = Nothing
Set subrpt = Nothing
End If
Next
Next
Set Sect = Nothing
Dim orpt As CRAXDRT.Report
Dim Sect As CRAXDRT.Section
Dim subrpt As CRAXDRT.Report
Dim subrpt1 As CRAXDRT.Report
Dim db As CRAXDRT.Database
Dim dbtables As CRAXDRT.DatabaseTables
Dim dbtable As CRAXDRT.DatabaseTable
.Connect = "Password=" & pass & ";User ID= " & user & ";DSN=" & data & ";DSN=" & server
.ReportTitle = "药品入库单"
.ReportFileName = App.Path & "\Rpt\Rpt.rpt"
.SelectionFormula = "{VW.id}=" & rs!id
.Action = 1
End With
CRpt 是什么类型的变量