Jun 21, 2002 #1 longmatch Programmer Joined Nov 1, 2001 Messages 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
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
Jun 23, 2002 #2 tedsmith Programmer Joined Nov 23, 2000 Messages 1,762 Location AU 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 Upvote 0 Downvote
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