Results 1 to 6 of 6

Thread: [RESOLVED] multiple table in data report

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2009
    Posts
    36

    Resolved [RESOLVED] multiple table in data report

    im using vb6..i want to use data from 2 different table using data environment. i already use command child to add another table, but feilds from 2nd table cannot drag into data report.

    another problem is how to refresh/update data report since i have to close and restart my application.

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

    Re: multiple table in data report

    Moved To Reporting

  3. #3
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,195

    Re: multiple table in data report

    If you need data from two tables in the parent command then you'll need to use a SQL statement. Like
    Code:
    select * from table1 inner join table2 on table1.somefield=table2.somefield
    To refresh the dataenvironment you need to close the recordset, like
    Code:
    If dataenvironment1.rsCommand1.State = adStateOpen Then
         dataenvironment1.rsCommand1.Close
    End If
    datareport1.show

  4. #4

    Thread Starter
    Member
    Join Date
    Jan 2009
    Posts
    36

    Re: multiple table in data report

    i have problem using SQL query..

    select * from borrow inner join staff on borrow.bookID=staff.ID

    this is my link....but both my table has fields such state and borrowBook.
    so fields under command(in data environment) will write as borrow.state,borrow.borrowBook, staff.state,staff.borrowBook and the ID's...
    when run the data report form, error will displayed "borrow.state not find"

    is there any way so i can set such borrow.state as borrow only ??
    or i have to redesign my database???

  5. #5
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,195

    Re: multiple table in data report

    Since you changed the DE you'll have to delete the text boxes on the report like "state" and then drag and drop the new "borrow.state" from the DE.

  6. #6
    Registered User
    Join Date
    Apr 2015
    Posts
    2

    Re: [RESOLVED] multiple table in data report

    I am trying to prepare a data report basing on two linked tables. Even though I used parent command and child command structure, i could not get fields form two tables, but I am getting fields from only one table in the Datareport

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