CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 1999
    Posts
    15

    How to print the data in a Recordset

    Windows 98 & VB6
    I create a Recordset and insert some data into this.
    Set myRS = New ADODB.Recordset
    With myRS.Fields
    .Append "ID", adSmallInt
    .Append "Start", adDate
    .Append "End", adDate
    .Append "Duration", adInteger
    .Append "Subject", adBSTR
    .Append "Body", adBSTR
    End With
    myRS.Open
    For Each myAppointmentItem In myItems
    If Not myAppointmentItem.AllDayEvent Then
    i = i + 1
    myRS.AddNew
    myRS.Fields("ID") = i
    myRS.Fields("Start") = myAppointmentItem.Start
    myRS.Fields("End") = myAppointmentItem.End
    myRS.Fields("Duration") = myAppointmentItem.Duration
    myRS.Fields("Subject") = myAppointmentItem.Subject
    myRS.Fields("Body") = myAppointmentItem.Body
    End If
    Next myAppointmentItem

    Then, how can I use DataReport to print the data in this Recordset?


  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: How to print the data in a Recordset

    add a DataReport to your project.
    name it "dr"
    right click on the Data report design window and "insert control/textBox"
    set the DataField property to "Subject"
    repeat this process for all your fields.

    add the following code:
    myrs.Fields("Body") = "Body"
    Set dr.DataSource = myrs
    dr.Show



    That's it.


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

Featured