Use ODBC API connect Oracle Database 
Author Message
 Use ODBC API connect Oracle Database

Hi,

I have very exciting development, using VB5 CCE (Microsoft Beta 1) with windows API, odbc32.dll connect Oracle database.
I also create an ActiveX Control.
It works, but retrieving data only show integer data field, no string data field.
I am struggling this problem this whole week.
I have this kind of program working well in VB3.
And, the result is right if I use ODBC Test.

Following is my SQL Log,

SQLAllocEnv(phenv01C26010);
SQLAllocConnect(henv01C26010, phdbc001CC5E8);
SQLConnect(hdbc001CC5E8, "pbatest", -3, "apeng", -3, "********", -3);
SQLAllocStmt(hdbc001CC5E8, phstmt0022D240);
SQLExecDirect(hstmt0022D240, "select rollup_id,name from rollup_summary", -3);
SQLBindCol(hstmt0022D240, 1, 1, rgbValue, 21, pcbValue);
SQLBindCol(hstmt0022D240, 2, 1, rgbValue, 51, pcbValue);
SQLFetch(hstmt0022D240);
SQLFetch(hstmt0022D240);
SQLFetch(hstmt0022D240);
SQLFetch(hstmt0022D240);
SQLFetch(hstmt0022D240);
SQLFetch(hstmt0022D240);
SQLFetch(hstmt0022D240);
SQLFetch(hstmt0022D240);
SQLFetch(hstmt0022D240);
SQLFetch(hstmt0022D240);
SQLFetch(hstmt0022D240);
SQLFetch(hstmt0022D240);
SQLFetch(hstmt0022D240);
SQLFetch(hstmt0022D240);
SQLFetch(hstmt0022D240);
SQLFetch(hstmt0022D240);
SQLFetch(hstmt0022D240);
SQLFetch(hstmt0022D240);
SQLFetch(hstmt0022D240);
SQLFetch(hstmt0022D240);
SQLError(henv00000000, hdbc00000000, hstmt0022D240, szSqlState, pfNativeError, szErrorMsg, 256, pcbErrorMsg);
SQLFreeStmt(hstmt0022D240, 1);

Obviously, there is an error.
I appreciate any information and help.

Thanks a lot.

-alex



Tue, 11 May 1999 03:00:00 GMT  
 Use ODBC API connect Oracle Database

SQLBindCol doesn't work on VB strings since VB likes to move them around in
RAM a lot.  You need to allocate the space for the string with the API then
use API string copy commands.  I've never actually done this, but I know of
people who have.

I just use the SQLGetData function to get one row at a time.  It's a bit
slower, but much easier.

If you find out how to do a SQLBindCol on strings, please let me know.
--
Keith Benedict
Software Engineer
Triad Systems



: Hi,
:
: I have very exciting development, using VB5 CCE (Microsoft Beta 1) with
windows API, odbc32.dll connect Oracle database.
: I also create an ActiveX Control.
: It works, but retrieving data only show integer data field, no string
data field.
: I am struggling this problem this whole week.
: I have this kind of program working well in VB3.
: And, the result is right if I use ODBC Test.
:
: Following is my SQL Log,
:
: SQLAllocEnv(phenv01C26010);
: SQLAllocConnect(henv01C26010, phdbc001CC5E8);
: SQLConnect(hdbc001CC5E8, "pbatest", -3, "apeng", -3, "********", -3);
: SQLAllocStmt(hdbc001CC5E8, phstmt0022D240);
: SQLExecDirect(hstmt0022D240, "select rollup_id,name from rollup_summary",
-3);
: SQLBindCol(hstmt0022D240, 1, 1, rgbValue, 21, pcbValue);
: SQLBindCol(hstmt0022D240, 2, 1, rgbValue, 51, pcbValue);
: SQLFetch(hstmt0022D240);
: SQLFetch(hstmt0022D240);
: SQLFetch(hstmt0022D240);
: SQLFetch(hstmt0022D240);
: SQLFetch(hstmt0022D240);
: SQLFetch(hstmt0022D240);
: SQLFetch(hstmt0022D240);
: SQLFetch(hstmt0022D240);
: SQLFetch(hstmt0022D240);
: SQLFetch(hstmt0022D240);
: SQLFetch(hstmt0022D240);
: SQLFetch(hstmt0022D240);
: SQLFetch(hstmt0022D240);
: SQLFetch(hstmt0022D240);
: SQLFetch(hstmt0022D240);
: SQLFetch(hstmt0022D240);
: SQLFetch(hstmt0022D240);
: SQLFetch(hstmt0022D240);
: SQLFetch(hstmt0022D240);
: SQLFetch(hstmt0022D240);
: SQLError(henv00000000, hdbc00000000, hstmt0022D240, szSqlState,
pfNativeError, szErrorMsg, 256, pcbErrorMsg);
: SQLFreeStmt(hstmt0022D240, 1);
:
: Obviously, there is an error.
: I appreciate any information and help.
:
: Thanks a lot.
:
: -alex

:



Fri, 14 May 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Problem connecting to Oracle Database using ODBC

2. How to connect VB witout usin ODBC to Oracle databases

3. Connecting to an oracle database with dao and odbc

4. HELP: Data Access Objects w/ ODBC connected to Oracle Database

5. How to export a database as ORACLE database using ODBC

6. how to connect ORACLE database through ODBC?

7. HELP: Data Access Objects w/ ODBC connected to Oracle Database

8. How to connect to ORACLE other than using ODBC

9. Connecting to Oracle using ODBC and DAO

10. Error Connect to ORACLE using ODBC - MSORCL32.DLL

11. VB4/16 Connect to SQLSERVER using ODBC API Functions

12. How to connect to an Oracle database using Access

 

 
Powered by phpBB® Forum Software