ComponentOne VSView Reporting Edition
Custom DAO Recordsets

You would use custom DAO recordsets for the same reasons you would use custom ADO recordsets, plus you might get slightly better performance and make deployment of your application easier (in case some of your clients do not have MSDAC/OLEDB installed on their computers).

Using custom DAO recordsets is exactly the same as using custom ADO recordsets, except of course for the code that creates the recordset itself. For example:

Example Title
Copy Code
Private Sub CreateReport()

 

  ' create DAO recordset

  Dim db As DAO.Database

  Dim rs As DAO.Recordset

  Dim strRS As String

  strRS = vsr.DataSource.GetRecordSource(True)

  Set db = OpenDatabase("c:\VB98\NWind.mdb")

  Set rs = db.OpenRecordset(strRS, dbOpenDynaset)

 

  ' load report

  vsr.Load "RepDef.xml", "My Report"

 

  ' render report

  vsr.Datasource.Recordset = rs

  vsr.Render vp

 

  ' done

  rs.Close

  Set rs = Nothing

End Sub

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback