oracle occi / instantclinet vc6 oracle 9i getString 错误解决

环境:oracle 9i occi / instantclient 10.1.0.5 vc 6

在取数据时,getString(1)正常.但getSting (2)即.取第二个string时,就会报错.

解决方法,参照metalink 文档ID 198902.1]

具体内容如下:

[@more@]

OCCI Results in an Assertion Error _CrtlsValidHeapPointer(pUserData) [ID 198902.1]

--------------------------------------------------------------------------------

Modified 29-JAN-2003 Type PROBLEM Status PUBLISHED


Problem Description
-------------------

OCCI applications may compile fine but produce one of the following errors
during run-time.

"Debug Assertion Failed"

File: dbgheap.c
Line: 1044
Expression: _CrtlsValidHeapPointer(pUserData)

Pressing Ignore on the message box results in the following error:

File: dbgheap.c
Line: 1050
Expression: _BLOCK_TYPE_IS_VALID(pHead0>nBlockUse)

Although the line number(s) may vary the key is to focus on the error which
is occuring within the dbgheap.c file.

It has yet to be determined all the scenarios which will cause this error, but
it has reproduced when executing the getString of a Resultset object as well
as the getVector command.

Note, that the same code will usually work fine on non Window platforms.

Solution Description
--------------------

Compiling with the make file instead of the MSVC gui should work, but if
attempting to compile with the gui, you will need to ensure the following
variables are define within the project:
- WIN32COMMON
- _DLL
- _MT

Actually using the compiler option /MD will define the _DLL and _MT macros.
So, you have the option of setting the compiler option (/MD) or defining the
marcos directly (_DLL, _MT) within the project.

You will need to include the following libraries for linking in addition to
the standard OCI library:
- msvcrt.lib
- msvcprt.lib
- /nodefaultlib:libcd

Explanation
-----------
Apparently the code requires linking with specific run-time libraries. Not including
these entries causes the application to be built using different libraries.

References
----------
Bug:2491694 OCCI PROGRAM GIVES -- DEBUG ASSERTION FAILED
Bug:2630255 OCCI: ASSERTION ERRORS WHEN EXECUTING GETSTRING OF A RESULTSET OBJECT
Bug:2095479 DESTRUCTOR OF THE STRING RETURNED BY METHOD GETSTRING FAILS

Additional Search Words
-----------------------
Crash
CrtlsValidHeapPointer
dbgheap


Related

--------------------------------------------------------------------------------
Products
--------------------------------------------------------------------------------

Oracle Database Products > Oracle Database > Oracle Database > Oracle Server - Enterprise Edition
Oracle Database Products > Oracle Database > Oracle Database > Oracle Server - Personal Edition
Oracle Database Products > Oracle Database > Oracle Database > Oracle Server - Standard Edition

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/197458/viewspace-1030450/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/197458/viewspace-1030450/

你可能感兴趣的:(oracle occi / instantclinet vc6 oracle 9i getString 错误解决)