无法使用OCILIB连接到11g [英] Cannot connect to 11g using OCILIB

查看:172
本文介绍了无法使用OCILIB连接到11g的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在使用OCILIB( http://orclib.sourceforge.net/ [

Hi,

I am using OCILIB (http://orclib.sourceforge.net/[^]) to connect to ORACLE from my c++ program.
But whenever i try to connect to 11g database. It crashes while calling OCI_ConnectionCreate. Application works fine for 10g.


Any clue ?



It works for one more scenario,
If i create oledb connection to the same database and close it. I can connect through 11g as well. Dont know how it works :(

推荐答案

它崩溃了,因为我从dllmain函数调用OCIInitialize函数.我将其移至其他函数,并且代码正在工作. ...故事的寓意:拇指法则是,我们不应在dllmain中使用任何用户代码.
It was crashing , as i was calling OCIInitialize function from dllmain function. i moved it to other function and the code is working.... Moral of the story : Thumb rule is , we should not use any user code in dllmain.


如果要连接到Oracle 11g,则必须使用Oracle的OCILIB 11g,而不是Oracle 10中的那个.因此,更改lib并重新生成程序:)
If you want to connect to Oracle 11g, then you have to use OCILIB from Oracle 11g, not the one from Oracle 10. So, change the lib and rebuild the program :)


这篇关于无法使用OCILIB连接到11g的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆