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_TX N_READ_UNCOMMITTED)
!= SQL_SUCCESS) {
SQLErrorMessageBox(henv,hdbc,hstmt,"Connect",(LPST R)&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",(LPST R)&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. 3 5832
"Lee" <le******@yahoo.com> wrote in message
news:6b**************************@posting.google.c om... 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.
Try as I might, I cannot find a single question or comment about
C++ in your post.
Perhaps you meant to post to an "Informix" and/or "ODBC" newsgroup?
-Mike
"Mike Wahler" <mk******@mkwahler.net> wrote in message news:<K%*****************@newsread1.news.pas.earth link.net>... "Lee" <le******@yahoo.com> wrote in message news:6b**************************@posting.google.c om... 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.
Try as I might, I cannot find a single question or comment about C++ in your post.
Perhaps you meant to post to an "Informix" and/or "ODBC" newsgroup?
-Mike
Hi Mike,
Thanks for go through my questions. I developed my tap using VC++. I
used the code below to connect to the informix database. My question
is how can i bind one port no to connect to the database?? thanks for
helping.
if (SQLSetConnectOption(hdbc,SQL_TXN_ISOLATION,SQL_TX N_READ_UNCOMMITTED)
!= SQL_SUCCESS) {
SQLErrorMessageBox(henv,hdbc,hstmt,"Connect",(LPST R)&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",(LPST R)&szRetMsg);
::MessageBox(NULL,szRetMsg,"Tap32",MB_ICONSTOP|MB_ TASKMODAL);
PostQuitMessage(0);
return FALSE;
}
"Lee" <le******@yahoo.com> wrote in message
news:6b**************************@posting.google.c om... "Mike Wahler" <mk******@mkwahler.net> wrote in message
news:<K%*****************@newsread1.news.pas.earth link.net>... "Lee" <le******@yahoo.com> wrote in message news:6b**************************@posting.google.c om... 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.
Try as I might, I cannot find a single question or comment about C++ in your post.
Perhaps you meant to post to an "Informix" and/or "ODBC" newsgroup?
-Mike
Hi Mike, Thanks for go through my questions. I developed my tap using VC++. I used the code below to connect to the informix database. My question is how can i bind one port no to connect to the database?? thanks for helping.
if (SQLSetConnectOption(hdbc,SQL_TXN_ISOLATION,SQL_TX N_READ_UNCOMMITTED) != SQL_SUCCESS) { SQLErrorMessageBox(henv,hdbc,hstmt,"Connect",(LPST R)&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",(LPST R)&szRetMsg); ::MessageBox(NULL,szRetMsg,"Tap32",MB_ICONSTOP|MB_ TASKMODAL); PostQuitMessage(0); return FALSE; }
Try as I might, I cannot find a single question or comment about
C++ in your post.
Perhaps you meant to post to an "Informix" and/or "ODBC" newsgroup?
Before posting a message to comp.lang.c++ again, please read this: http://www.slack.net/~shiva/welcome.txt
If you don't understand why I'm replying as I do, please
see www.usenet.org
-Mike This discussion thread is closed Replies have been disabled for this discussion. Similar topics
reply
views
Thread by Greg |
last post: by
|
reply
views
Thread by Alberto Vera |
last post: by
|
2 posts
views
Thread by Jan Kesten |
last post: by
|
1 post
views
Thread by Alex Hardin |
last post: by
|
7 posts
views
Thread by Bill Nguyen |
last post: by
| | | |
reply
views
Thread by kurakar |
last post: by
| | | | | | | | | | |