我想用SQLAPI++ 对我的MYSQL数据库进行连接,可在用官方网站的example时候都出现问题,编译的时候没报错
可运行的时候,提示说没找到SQLAPI.DLL,请用过的赐招,要怎样去配置到SQLAPI++到开发环境VS20008中使用
下面我给出example代码
#include <stdio.h> // for printf #include <SQLAPI.h> // main SQLAPI++ header
int main(int argc, char* argv[]) { SAConnection con; // create connection object
try { // connect to database // in this example it is Oracle, // but can also be Sybase, Informix, DB2 // SQLServer, InterBase, SQLBase and ODBC con.Connect( "test", // database name "root", // user name "13542024187", // password SA_Oracle_Client);
printf("We are connected!\n");
// Disconnect is optional // autodisconnect will ocur in destructor if needed con.Disconnect();
printf("We are disconnected!\n"); } catch(SAException &x) { // SAConnection::Rollback() // can also throw an exception // (if a network error for example), // we will be ready try { // on error rollback changes con.Rollback(); } catch(SAException &) { } // print error message printf("%s\n", (const char*)x.ErrText()); }
return 0; }
先谢谢大家了!!! |