Results 1 to 11 of 11

Thread: [RESOLVED] 2 database in 1 data report?

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2007
    Posts
    5

    Resolved [RESOLVED] 2 database in 1 data report?

    please help me,
    i'm using vb 6
    my report needs data using two database, how?
    can you give me some examples
    thanks in advance

  2. #2
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    Re: 2 database in 1 data report?

    Welcome to the forums!

    Depends on the nature of the data your getting from the 2 databases (eg. your doing a union or a join) and if you have access to db schema (eg. create linked tables) and if your setting up the data report progmatically or at desugn time (eg. data environment).

    To get records from a table in another database http://www.vbforums.com/showthread.p...ghlight=select

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2007
    Posts
    5

    Re: 2 database in 1 data report?

    im using data environment,
    but i have problem in DataMember,
    i want to use 2 database in 1 report?
    is there a way?

  4. #4
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    Re: 2 database in 1 data report?

    Depends what your getting from the two databases... this is not possible http://www.vbforums.com/showthread.p...ghlight=select because the data report is not a sophisticated (eg. compared to crystal)

    There has to be a way to relate them or tie them up, eg. select join, select union. If there is a way to assign data from the 2 databases into one recordset (you will have to specify the SQL using SELECT...FROM...IN as demonstrated in link in post#2), then you can setup the data report through code http://www.vbforums.com/showthread.p...ataenvironment
    Last edited by leinad31; Mar 6th, 2007 at 10:16 AM.

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

    Re: 2 database in 1 data report?

    Moved

    What kind of databases?

  6. #6

    Thread Starter
    New Member
    Join Date
    Mar 2007
    Posts
    5

    Re: 2 database in 1 data report?

    microsoft access 2003,
    2 databases, 2 recordset,
    let's put it in this way...
    dbA = database A
    i have data from dbA, and i'm gettting data to my data report from dbA, and i have also data from dbB, how can i put the data in my data report with dbA and dbB...
    in vb6 you can only choose 1 datamember..
    please help me

  7. #7
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    Re: 2 database in 1 data report?

    Not much information to work with, yes your trying to get data from 2 databases but what are the details?

    Post the queries for data A and data B (assuming your querying them separately or creating separate reports), and indicate which columns are included in the report(A+B) and what is the sample output (or sample layout) of report(A+B).

    Then we will see if its possible or not.

  8. #8

    Thread Starter
    New Member
    Join Date
    Mar 2007
    Posts
    5

    Re: 2 database in 1 data report?

    here is the form where you will input the data



    and here is the form where you can view the reports
    each record has premium...
    so as you see the total premium is in a textbox, and save in a different database


    here is the data report



    how can i put my total premium, (that i was saved in otherdatabase),,,, in the data report.

    the first database is for the records, and the second is the total premium...
    (


    here is what i want to print...

    producer.....assured......premium ->>> save in the database A

    sherll...........aa............1560.59
    dan.............bb............1659.78



    total premium: 3220.37 ->>> save in the database B
    Last edited by nyerks; Mar 6th, 2007 at 10:35 PM.

  9. #9
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    Re: 2 database in 1 data report?

    No need to query the other database, just total the premiums in current database using rptFunction control for data report. Place it in report footer section.

  10. #10

    Thread Starter
    New Member
    Join Date
    Mar 2007
    Posts
    5

    Re: 2 database in 1 data report?

    thank you very much daniel,
    i really appreciate your help...

  11. #11
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    Re: 2 database in 1 data report?

    Your welcome ^^ Please mark the thread as resolved if you no longer have any other questions. Thanks.

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