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

Thread: ADODC

  1. #1
    Join Date
    Apr 2001
    Posts
    33

    ADODC

    hi!i'm wilson. I need help on ADODC control. i using the ADODC control to get the database and the data displayed on the datagrid.

    i need to link 2 tables and displayed the all data on same datagrid. can it be done ?

    FYI, i usign SQL command which written in the property page SQL Command field in the ADODC control - RecordSource. The 2 tables are using same data type and fields. Now, i able to connect one table. how i write the SQL command to coonnect 2 tables? Is that other way to solve the problem?

    Here the SQL Command (call one table)

    SELECT CUSTOMERID,MSISDN,DEVICETYPE, SERVICECODE,IN_DATETIME, OUT_DATETIME, MESSAGE_STATUS,CSN,HOSTSTAN, MESSAGEID,USERID,STAN,GATEWAYID, DEVICE_MSG,DEVICE_MSG_LENGTH,HOST_MSG,HOST_MSG_LENGTH, RESPONSE_MSG, RESPONSE_MSG_LENGTH,RAW_MESSAGE,BATCH_NO, RETRY_NO,ERROR_CODE,ERROR_MSG,BROKERID FROM GWTRANSACTION

    Regards,
    Wilson Chai

  2. #2
    Join Date
    Jan 2000
    Location
    Saskatchewan, Canada
    Posts
    595

    Re: ADODC

    This is an example of a join. This is joining two tables named AcctsReceivable and Province.

    SELECT * FROM AcctsReceivable Left JOIN Province ON AcctsReceivable.ProvinceID=Province.ProvinceID ORDER BY CustName

    David Paulson

  3. #3
    Join Date
    Aug 2000
    Location
    NY, USA
    Posts
    632

    Re: ADODC

    Use UNION:
    "SELECT CUSTOMERID,MSISDN FROM GWTRANSACTION
    UNION SELECT CUSTOMERID,MSISDN FROM SECONDTABLENAME"

    Vlad


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