Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

connecting INFORMIX via ODBC using C

Status
Not open for further replies.

beon

Programmer
Jan 6, 2003
3
SI
Hello,

I have a problem accesing INFORMIX DBMS via ODBC using C and INTERSOLV 3.1 ODBC DRIVER on Windows 2000 Server.

My source codel looks like:

rc = SQLAllocEnv (&henv);
rc = SQLAllocConnect (henv, &hdbc);
rc = SQLConnect (hdbc,(unsigned char *)dbname, SQL_NTS, (unsigned char *)dbuser, SQL_NTS, (unsigned char *)dbuser_passwd, SQL_NTS);

//**** SELECT ****//
lstrcpy(sql_command,"SELECT area_code, from_dn, to_dn FROM numbering_plan");
rc = SQLExecDirect (hstmt, (unsigned char *)sql_command, SQL_NTS);

The following errors occured:
SQL connect returns 1; SQL_SUCCESS_WITH_INFO
SQLExecDirect returns -2; SQL_INVALID_HANDLE

Where is the catch? What means SQL_INVALID_HANDLE? What am I doing wrong?

Best regards!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top