读书人

OTL连接oracle的简单有关问题

发布时间: 2012-03-02 14:40:28 作者: rapoo

OTL连接oracle的简单问题
写了用otl连接oracle的简单的测试代码:
#include <iostream>
#include <string>
#include "otlv4.h "
//#include "oci.h "
#define OTL_ORA9I
//#define OTL_ORA_TIMESTAMP


void main()
{
otl_conn conct();
std::string strLink( "kjwg/kjwg@kjwg ");
try
{
conct.rlogon(strLink);
}
catch (...)
{
std::cout < < "连接失败! ";
return;
}
std::cout < < "连接成功! "
conct.logoff();
}
编译出的错误有:

2.cpp
E:\项目\2\2.cpp(11) : error C2065: 'otl_conn ' : undeclared identifier
E:\项目\2\2.cpp(11) : error C2146: syntax error : missing '; ' before identifier 'conct '
E:\项目\2\2.cpp(11) : error C2065: 'conct ' : undeclared identifier
E:\项目\2\2.cpp(15) : error C2228: left of '.rlogon ' must have class/struct/union type
E:\项目\2\2.cpp(23) : error C2146: syntax error : missing '; ' before identifier 'conct '
E:\项目\2\2.cpp(23) : error C2228: left of '.logoff ' must have class/struct/union type
Error executing cl.exe.

貌似是因为 'otl_conn ' 没有定义,但是我已经把otlv4.h包含进来了,这是怎么回事?


[解决办法]
otlv4.h 可以兼容多个平台,sql server, access, oracle 等

不过你怎么想到用otl呢?

读书人网 >C++

热点推荐