473,413 Members | 1,705 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

Specify port no to connect to Informix Database through ODBC

Lee
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.
Jul 22 '05 #1
3 6038
"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
Jul 22 '05 #2
Lee
"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;
}
Jul 22 '05 #3

"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
Jul 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Greg | last post by:
Hi All: Using PHP, how do I connect to an Informix database using an ODBC connection string like this: "Dsn='';Driver={INFORMIX 3.30 32...
0
by: Alberto Vera | last post by:
I use win32com.client to create ADODB.Connection and ADODB.Recordset: win32com.client.Dispatch('ADODB.Connection') win32com.client.Dispatch('ADODB.Recordset') I can connect to an access database...
2
by: Jan Kesten | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, does anybody know, if there is a module to connect to an Informix database? I looked around, but I have seen there only modules for...
1
by: Alex Hardin | last post by:
Hey, I'm trying to use the connect to database wizard to connect to a MySQL database on my web server, 66.235.193.45 (I'm actually not sure if that points specifically to my part of the server, if...
7
by: Bill Nguyen | last post by:
I have this connection string using ODBC DSN Dim FactorJaco As String = "dsn=jaco;catalog=factor;uid=user;pwd=passord" This requires an ODBC DSN (jaco) at every client PC. I need to use DSN-less...
3
by: ocean001 | last post by:
hi guys, i am trying to create a mobile interface that can check the balance from my database(ODBC). and i am using visual studio C++. but i am not too familiar with C++, can anyone please help me...
4
by: Gourk | last post by:
I'm fairly new to the whole MySQL thing, But not new to SQL. So doing most of this was fairly easy, but I have a hosting service with Godaddy.com, and Yes it supports MySQL 5.0 and is installed and...
0
by: AbuArwa | last post by:
Hi All; I want to update Mysql database from Informix database but i have a huge table and if some thing wrong happens to it, our service can be down, i need to know the feasibility of...
0
by: kurakar | last post by:
Dear all, How to connect SQL Database from Server 2005 through dyndns in php, My dyndns address - xxx-xxx.dyndns.org Port - 3389(default) This is the code i am using: $dsn =...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.