oracle occi / instantclinet vc6 oracle 9i getString 錯誤解決

jidongzheng發表於2010-01-10

環境: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/,如需轉載,請註明出處,否則將追究法律責任。

相關文章