X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id E7A8CD1B463 for ; Thu, 27 Nov 2003 13:22:13 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 76344-08 for ; Thu, 27 Nov 2003 09:21:46 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id 6011BD1B47B for ; Thu, 27 Nov 2003 09:21:43 -0400 (AST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.12.9/8.12.9) with ESMTP id hARDLhNu008388 for ; Thu, 27 Nov 2003 13:21:43 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id hARDLCfT008345 for pgsql-odbc@postgresql.org; Thu, 27 Nov 2003 13:21:12 GMT From: lee_5398@yahoo.com (Lee) X-Newsgroups: comp.databases.postgresql.interfaces.odbc Subject: Specify port no to connect to Informix Database through ODBC Date: 27 Nov 2003 05:21:14 -0800 Organization: http://groups.google.com Lines: 44 Message-ID: <6b4e4323.0311270521.4744762d@posting.google.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: groups-abuse@google.com To: pgsql-odbc@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=2.4 tagged_above=0.0 required=5.0 tests=BAYES_30, FORGED_YAHOO_RCVD, FROM_ENDS_IN_NUMS X-Spam-Level: ** X-Archive-Number: 200311/130 X-Sequence-Number: 3532 Hi, I'm developing a socket program to connect to Informix database through the ODBC. In here i called my socket program as "tap" . My tap will listen for data from unix through port 1070. After checking of the data, tap will then insert the data to the informix database. I know we can point the tap to one specified port in Informix database through the services file. My question is how should i know to which port my tap program send out to the informix database or should i ask how should i specify one port to connect to the informix and lock that port from other process to use it?For current moment, my tap will randomly pick one port to connect to informix database. My coding for connect to Informix looks like below; // Initialize ODBC variables // NOTE : Make sure these variables is intialized before used. henv = SQL_NULL_HENV; hdbc = SQL_NULL_HDBC; hstmt = hOrderStmt = hTradeStmt = SQL_NULL_HSTMT; SQLAllocEnv(&henv); SQLAllocConnect(henv, &hdbc); char szRetMsg[500]; memset(szRetMsg, '\0', sizeof(szRetMsg)); if (SQLSetConnectOption(hdbc,SQL_TXN_ISOLATION,SQL_TXN_READ_UNCOMMITTED) != SQL_SUCCESS) { SQLErrorMessageBox(henv,hdbc,hstmt,"Connect",(LPSTR)&szRetMsg); ::MessageBox(NULL,szRetMsg,"Tap32",MB_ICONSTOP|MB_TASKMODAL); PostQuitMessage(0); return FALSE; } if (SQLConnect(hdbc, szDSN, SQL_NTS, szUserID, SQL_NTS, szPassword, SQL_NTS) != SQL_SUCCESS) { SQLErrorMessageBox(henv,hdbc,hstmt,"Connect",(LPSTR)&szRetMsg); ::MessageBox(NULL,szRetMsg,"Tap32",MB_ICONSTOP|MB_TASKMODAL); PostQuitMessage(0); return FALSE; } I really appreciate if someone can help me out. Thank you very much.