关于OCCI问题,请高手指教
请问我这段程序哪有错误呢?编译是通过的,但调试却发现根本进不了程序报内存错误,请各位高手指教多谢!#include "stdafx.h"
#include <iostream>
#include "occi.h"
#include <string>
using namespace std;
using namespace oracle::occi;
#pragma comment(lib,"oraocci11d.lib")
int main()
{
//创建环境变量
Environment *env = Environment::createEnvironment(Environment::OBJECT);
//连接SQL Server用户名/密码
string username = "SYSTEM";
string userpass = "ORCL";
string connstr = "166.111.138.186:1521";
string sql;
//创建连接
Connection *conn = env->createConnection(username,userpass,connstr);
if(conn == NULL)
{
cout<<"connction SQL Server failed!"<<endl;
return 0;
}
//执行一条sql语句
Statement *ste = conn->createStatement();
sql = "INSERT INTO TEST(ID,NAME,AGE) VALUES(4,'A',26)";
ste->setSQL(sql);
ste->executeUpdate();
//关闭连接
conn->terminateStatement(ste);
env->terminateConnection(conn);
Environment::terminateEnvironment(env);
return 0;
}
补充:.NET技术 , C#