Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to generate report based upon recordset

Status
Not open for further replies.

longmatch

Programmer
Nov 1, 2001
406
I know that datareport can use dataEnvironment connection and command. Is there any way we can use recordset as datasource of data report?

Thanks

haijun
 
Try this
Open a Connection object to the database. Use the Connection object's Execute method to create a Recordset containing the desired records.

Then set the DataReport's DataSource property to the Recordset.

Set rs = conn.Execute("SELECT * FROM Books", , adCmdText)

' Connect the Recordset to the DataReport.
Set rptBooks.DataSource = rs
rptBooks.WindowState = vbMaximized
rptBooks.Show vbModal
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top