CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: VB Data Report

  1. #1
    Join Date
    Jan 2000
    Location
    Dubai,UAE
    Posts
    10

    VB Data Report

    I am facing following problems while working with data report(Visual Basic 6)

    1. Please tell me how to pass sql to Command Object of dataenviroment at run time.

    For example:
    Name Age
    ==== ===
    Pavan 12
    Pallavi 10
    Swati 6
    Deepak 35

    In case if I want Names where age is less than a number

    2. Title for the Data Report

    In case if I select all the records where age is less than 20
    I want to give title to the report as

    List of Names of age less than 20


    Please help me.



  2. #2
    Join Date
    Jul 1999
    Location
    Athens, Hellas
    Posts
    769

    Re: VB Data Report

    I would do it like this way:


    private Sub DataReport_Initialize()
    'requery recordset
    If deYourDataEnvironment.rsYourReturningRecordset.State = adStateOpen then
    deYourDataEnvironment.rsYourReturningRecordset.Requery
    End If
    'display only the desired results
    deYourDataEnvironment.rsYourReturningRecordset.Filter = " Age <= 20 "
    End Sub

    private Sub DataReport_QueryClose(Cancel as Integer, CloseMode as Integer)
    While me.AsyncCount > 0
    DoEvents
    Wend
    Unload me
    End Sub




    Michael Vlastos
    Automation Engineer
    Company SouthGate Hellas SA
    Development Department
    Athens, Greece

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