Results 1 to 3 of 3

Thread: It is possible to use data report without ADO ?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2007
    Location
    Malaysia
    Posts
    1,370

    It is possible to use data report without ADO ?

    I am not using database. I have listview and Picture box, It is possible to viewing this objects on data report and print it out? I always use data report with database.Have a simple code that use data report without database?

  2. #2
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: It is possible to use data report without ADO ?

    An ADO Recordset does not require a database. You can create an in-memory recordset using

    Code:
    Dim i as long
    Dim rs As ADODB.Recordset
    
    Set rs = New ADODB.Recordset
    rs.Fields.Append "CustomerId", adInteger
    rs.Fields.Append "CustomerName", advarChar, 30
    rs.Open
    
    For i = 1 to 50
       rs.AddNew Array("CustomerId", "CustomerName"), Array(i, "Customer # " & i)
       rs.Update
    Next
    If you don't want to use ADO you might be able to use a Collection(or BindingCollection) and a DataSource class as the report's data source. I have no idea if this works as I never tried it but the VB Help file shows you how to create Data-Aware classes. The example code in the help file does use ADO Recordsets but you should be able to convert it to use a Collection. Again, no idea if this will work...

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: It is possible to use data report without ADO ?

    Moved to reporting

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width