data report

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • slapshock
    New Member
    • Oct 2006
    • 57

    #1

    data report

    hi!!!
    can u help me with my problem??

    i dont know how to put two recordset in one datareport at the same time...or getting data from two tables and put in one datareport....
    i tried but it wont work....i dont know how to do it....
    pls help me

    i am new in programming....
    i hope that you can help me...
    i am using vb 6.0

    tnx in advance...
  • axtens
    New Member
    • Dec 2006
    • 32

    #2
    My experience is more on the VBScript side and VB itself. Given that, assuming you are using ADO to access the databases, create separately named recordsets.

    These are the functions I use for database stuff. Making them more VBish shouldn't be too hard.
    Code:
    function OpenDatabase( theFile )
        Dim oConnection
        On Error Resume Next
        Set oConnection = CreateObject( "ADODB.Connection" )
        oConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & theFile
        If Err.Number <> 0 Then
            Die "OpenDatabase", Err
        End If
        Err.Clear
        On Error GoTo 0
        Set OpenDatabase = oConnection
    end function
    
    Function OpenRecordSet( ByRef oDB, sQuery )
        Dim oRecordSet
        Set oRecordSet = CreateObject( "ADODB.RecordSet" )
        oRecordSet.Open sQuery, oDB, adOpenStatic, adLockOptimistic
        Set OpenRecordSet = oRecordSet
    End Function
    Just watch out for the options on the oRecordSet.Open as you may not want an adOpenStatic.

    I trust that's heading somewhere in the direction you want to go ...

    Kind regards,
    Bruce.

    Comment

    • aaryan
      New Member
      • Nov 2006
      • 82

      #3
      Originally posted by slapshock
      hi!!!
      can u help me with my problem??

      i dont know how to put two recordset in one datareport at the same time...or getting data from two tables and put in one datareport....
      i tried but it wont work....i dont know how to do it....
      pls help me

      i am new in programming....
      i hope that you can help me...
      i am using vb 6.0

      tnx in advance...
      hi slapshock,
      clarify one thing for me, do the data from two tables share a common column, like id or no:, something like that. in that case you can create a parent and child command in the data environment and drag and drop the desired fields in your report.
      if the above explanation is not satisfactory, pls elaborate.

      Comment

      Working...