Data Replication 2
Results 1 to 1 of 1

Thread: ODBC SQLdriverCnnect

  1. #1
    Costi Zaboura is offline World Wide Support Manager
    Join Date
    Aug 2006
    Posts
    300
    Rep Power
    14

    ODBC SQLdriverCnnect

    ODBC Drivers - general question - How to Use SQLdriverCnnect and Specify the QP name

    Description


    how a user should use SQldriverConnect and specify the QP remote name?

    Solution

    have a look at the following explanation/sample

    Example
    char ConnString[200],szCompleteConnStr[255];
    strcpy(ConnString,"DefTdpName=DB2;QpTdpName=NTserv er;OneTdpMode=1;")
    retcode=SQLDriverConnect(hdbc, NULL, ConnString,
    (SWORD)strlen(ConnString),
    szCompleteConnStr, 255, NULL,
    SQL_DRIVER_NOPROMPT);

    Explanation
    in this example QpTDPName was set to NTserver which is the name of the remote machine where the QP remote resides, in your case it is NT or AIX etc..

    Your binding configuration on the client should point to the remote machine e.g. NT server in the exmaple above.

    Here is the sample again but this time in COBOL-ODBC
    it would look something like the following

    STRING "DefTdpName=DSN_name;QpTdpName=NTserver;OneTdpMode =1;" DELIMITED BY " "
    INTO WS-CONNECT-STRING
    END-STRING
    PERFORM VARYING WS-CONNECT-STRING-LEN FROM 1 BY 1
    UNTIL WS-CONNECT-STRING(WS-CONNECT-STRING-LEN: ) = SPACES
    EXIT PERFORM CYCLE
    END-PERFORM
    MOVE LOW-VALUES
    TO WS-CONNECT-STRING(WS-CONNECT-STRING-LEN: )
    SUBTRACT 1 FROM WS-CONNECT-STRING-LEN
    ENTER C "SQLDRIVERCONNECT"
    USING ODBCAPI-HDBC
    , A-NULL
    , WS-CONNECT-STRING
    , WS-CONNECT-STRING-LEN
    , WS-COMPLETED-CONNECT-STRING
    , 257
    , A-NULL
    , SQL-DRIVER-NOPROMPT
    GIVING WS-ODBCAPI-RETURN-CODE
    Last edited by Admin_attu; 09-28-2006 at 05:07 AM.
    To Find Out more About Attunity Technology:
    Attunity
    or:
    Contact Us

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •