简体   繁体   English

创建连接时,Visual Studio 2010报告Oracle OCCI 11g的“访问冲突”

[英]Visual studio 2010 reporting “Access violation” for Oracle OCCI 11g when creating connection

When I tried to create a connection with Oracle OCCI 11g on Microsoft Visual Studio 2010, I got below error: 当我尝试在Microsoft Visual Studio 2010上与Oracle OCCI 11g建立连接时,出现以下错误:

Unhandled exception at 0x005a79c9 in OracleOCCI.exe: 0xC0000005: Access violation reading location 0x316c6561. OracleOCCI.exe中0x005a79c9处未处理的异常:0xC0000005:访问冲突读取位置0x316c6561。

My code is very simple as below: 我的代码非常简单,如下所示:

class DMLDemo
{
private:

    Environment *env;
    Connection *conn;
    Statement *stmt;

public:

    DMLDemo (string user, string passwd, string db)
    {
        env = Environment::createEnvironment (Environment::DEFAULT);
        if(env==nullptr)
            cout << "Failure";


            try
            {
                conn = env->createConnection (user, passwd, db);
        }
            catch (exception* e)
            {
                cout << "Error";
            }


    }

    ~DMLDemo ()
    {
        env->terminateConnection (conn);
        Environment::terminateEnvironment (env);
    }

};


int _tmain(int argc, _TCHAR* argv[])
{
    //01. Test Simple Connection
    try
    {
        DMLDemo demo("scott","Michael1","");
    }
    catch (exception* e)
    {
        cout << e->what();

    }

    getche();


    return 0;
}

I googled for some answers, seems that something is wrong with the compatibility between oracle dll version and the VC version. 我用谷歌搜索了一些答案,似乎oracle dll版本和VC版本之间的兼容性出了问题。

Anyone who has a solution for this? 有解决方案的人吗? Or just change to VS 2005? 或者只是更改为VS 2005?

I have been building VS08 and VS10 interfaces to the Oracle 11g( 11.2.0) 32 bit database. 我一直在为Oracle 11g(11.2.0)32位数据库构建VS08和VS10接口。 I found that a number of the sites providing occi11x.dlls, including my own Oracle installation, delivered in the V9 directory, were not compatible with the VS08 console app. 我发现在V9目录中提供的许多提供occi11x.dll的站点(包括我自己的Oracle安装)与VS08控制台应用程序不兼容。 Finally, I had to have the tested 'gold' binaries delivered to me from another location in the company. 最后,我必须从公司的另一个位置将经过测试的“金”二进制文件发送给我。 Once the x86 'gold' dll was installed in the console launch directory, the very same code functioned properly. 将x86'gold'dll安装在控制台启动目录中后,相同的代码即可正常运行。

I am searching for the same suitability in VS10 occi11x.dlls. 我正在VS10 occi11x.dll中搜索相同的适用性。 As yet I haven't found it. 到目前为止,我还没有找到它。 I am getting similar faults following the Environment creation. 创建环境后,我也遇到类似的错误。 Some dlls allow me to make a connection but fault when I try to do a ResultSet->next(), others won't allow me even to do the executeQuery(). 有些dll允许我建立连接,但尝试执行ResultSet-> next()时出错,其他dll甚至不允许我执行executeQuery()。 I think Oracle is remiss in not managing this properly. 我认为甲骨文没有适当地管理这个问题。

The 'broken' VS08 dlls sometimes had the correct dates and file size as the 'gold' dlls. “损坏”的VS08 dll有时具有与“金色” dll相同的正确日期和文件大小。 Perhaps an internal search of the dlls will discover which ones are workable. 也许对dll进行内部搜索会发现哪些是可行的。

http://www.oracle.com/technetwork/database/occidownloads-083553.html is the site that oracle uses to supply various occi dlls to match to Visual Studio. http://www.oracle.com/technetwork/database/occidownloads-083553.html是oracle用于提供各种occi dll以匹配Visual Studio的站点。 Perhaps their VS12 version is actually more compatible with the Oracle12c database. 也许他们的VS12版本实际上与Oracle12c数据库更兼容。

Okay, finally I installed VS 2008 and the code works out all right. 好的,最后我安装了VS 2008,代码工作正常。 Seems that the Oracle DLL compiled in 2008 would not work in VS2010. 似乎2008年编译的Oracle DLL在VS2010中不起作用。

Maybe someday, Oracle can publish its VS2010 Dlls... 也许有一天,Oracle可以发布其VS2010 Dlls。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 当Oracle 11g PL / SQL存储过程将BLOB作为OUT参数时,ODBC C ++(Visual Studio 2010)SQLPrepare(。)返回SQL_ERROR - ODBC C++ (Visual Studio 2010) SQLPrepare(.) returns SQL_ERROR when the Oracle 11g PL/SQL stored procedure has BLOB as OUT parameter "使用 OCCI 在 Oracle Database 11g 中存储无符号 64 位整数的最佳方法" - Best way to store an unsigned 64 bit integer in Oracle Database 11g using OCCI Visual Studio 2010上的访问冲突 - Access Violation on Visual Studio 2010 第一次机会异常……:访问冲突读取位置……使用 Visual Studio 2010 进行调试时 - First-chance exception at …: Access violation reading location … when debugging using Visual Studio 2010 cv :: SimpleBlobDetector detect()在Visual Studio 2010中产生访问冲突异常 - cv::SimpleBlobDetector detect() produce access violation exception in Visual Studio 2010 创建数据库连接时访问读取冲突 - Access reading violation when creating a database connection 与 OCCI next() 和 setDataBuffer() 的访问冲突 - Access Violation with OCCI next() and setDataBuffer() 在Visual Studio 2005中以调试模式运行时,OCCI应用程序崩溃 - OCCI app crashes when running in debug mode in Visual Studio 2005 无法通过OLE DB连接到Oracle 11g - Unable to connect to Oracle 11g via OLE DB Visual Studio 2010不稳定报告局部变量 - Erratic reporting of local variables by Visual Studio 2010
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM