Private Sub DataReport_Initialize()
Me.WindowState = vbMaximized
Me.Height = Printer.ScaleHeight
'
Dim BaseConnect As ADODB.Connection
Dim rsReport As ADODB.Recordset
Dim rsSql As String
'
' ** Open the database
Set BaseConnect = New ADODB.Connection
Set rsReport = New ADODB.Recordset
BaseConnect.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & StrGloNomBase & ";Persist Security Info=False"
BaseConnect.Open
'
' ** Select the data
rsSql = "select * from T_DEALS;"
rsReport.Open rsSql, BaseConnect, adOpenStatic, adLockReadOnly
'
' ** Define the fields on the report
Me.Sections("section2").Controls("Lbl_ReportTitle").Caption = "Total Report"
Set Me.DataSource = rsReport
End Sub
Partager