|
xp sp2+lr 8
代码如下:
#include "lrd.h"
Action()
{
static LRD_INIT_INFO InitInfo = {LRD_INIT_INFO_EYECAT};
static LRD_DEFAULT_DB_VERSION DBTypeVersion[ ] =
{
{LRD_DBTYPE_NONE, LRD_DBVERSION_NONE}
};
static void FAR * OraEnv1;
static void FAR * OraSvc1;
static void FAR * OraSrv1;
static void FAR * OraSes1;
static void FAR * OraStm1;
unsigned long rownum;
lrd_init(&InitInfo, DBTypeVersion);
lrd_initialize_db(LRD_DBTYPE_ORACLE,3, 0);
lrd_env_init(LRD_DBTYPE_ORACLE, &OraEnv1, 0, 0);
lrd_ora8_handle_alloc(OraEnv1, SVCCTX, &OraSvc1, 0);
lrd_ora8_handle_alloc(OraEnv1, SERVER, &OraSrv1, 0);
lrd_ora8_handle_alloc(OraEnv1, SESSION, &OraSes1, 0);
//连接数据库
lrd_server_attach(OraSrv1, "10.101.2.13", -1, 0, 0);
lrd_ora8_attr_set_from_handle(OraSvc1, SERVER, OraSrv1, 0, 0);
//设定数据库密码
lrd_ora8_attr_set(OraSes1, USERNAME, "scott", -1, 0);
lrd_ora8_attr_set(OraSes1, PASSWORD, "tiger", -1, 0);
//初始化连接session
lrd_ora8_attr_set_from_handle(OraSvc1, SESSION, OraSes1, 0, 0);
//开始连接数据库
lrd_session_begin(OraSvc1, OraSes1, 1, 0, 0);
lrd_ora8_handle_alloc(OraEnv1, STMT, &OraStm1, 0);
//设定查询语句
lrd_ora8_stmt (OraStm1, "SELECT * FROM table", 1, 0, 0);
//执行查询语句
lrd_ora8_exec(OraSvc1, OraStm1, 0, 0,&rownum, 0, 0, 0, 0, 1);
//释放连接数据库的各种变量
lrd_handle_free(&OraStm1, 0);
lrd_session_end(OraSvc1, OraSes1, 0, 0) ;
lrd_server_detach(OraSrv1, 0, 0);
lrd_handle_free(&OraEnv1, 0);
//lrd_end(0);
return 0;
}
编译没问题,运行提示:Error -- Unresolved symbol : lrdfnc_init
请大家帮忙 |
|