to nethermit(网络隐士): 求你帮个忙, 我下了一个mysql++, 但是编译的时候有错, 错误如下: c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xutility(723) : see declaration of 'std::reverse_iterator' d:\Workspace\Microsoft\mysql++\include\resiter1.hh(52) : see reference to class template instantiation 'const_subscript_container<OnType,ValueType,ReturnType,SizeType,DiffType>' being compiled求你指点指点, 我没有别的, 以分向谢!
//////////////////////////////////////////////////////////////////
学习,再学习。
在编译的时候,包含上 mysql 提供的库函数就可以了。
我也用 C 写 CGI ,数据库用的就是 mysql 。
我的主页上有源代码,你有兴趣可以去看看。http://linjiework.126.com
大家讨论讨论!
extern sysStateinfo stateinfo;mydbQry::mydbQry()
{
UCHAR szSqlState[0x100];
UCHAR szErrorMsg[0x100];
UCHAR szSqlConnect[0x100];
SWORD cbSqlConnect;
SDWORD NativeError;
SWORD ErrorMsg;
RETCODE retcode;
retcode = SQLAllocEnv(&henv);
if (retcode == SQL_SUCCESS)
retcode = SQLAllocConnect(henv, &hdbc);
else{
SQLError(SQL_NULL_HENV,SQL_NULL_HDBC,SQL_NULL_HSTMT,(UCHAR *)szSqlState,&NativeError,(UCHAR *)szErrorMsg,255,&ErrorMsg);
throw (char *)szErrorMsg;
} if (retcode == SQL_SUCCESS)
SQLSetConnectOption(hdbc, SQL_LOGIN_TIMEOUT, 5);
else{
SQLError(henv,SQL_NULL_HDBC,SQL_NULL_HSTMT,(UCHAR *)szSqlState,&NativeError,(UCHAR *)szErrorMsg,255,&ErrorMsg);
throw (char *)szErrorMsg;
}
char ConnectStr[200];
sprintf(ConnectStr,
"DSN=SCADA;UID=dbo;PWD=dbo");
retcode=SQLDriverConnect(hdbc,(HWND)NULL,
(UCHAR *)ConnectStr,
SQL_NTS,
szSqlConnect,
sizeof(szSqlConnect),
&cbSqlConnect,
SQL_DRIVER_COMPLETE); if (retcode == SQL_SUCCESS || retcode == SQL_SUCCESS_WITH_INFO){
}
else{
SQLError(henv,hdbc,SQL_NULL_HSTMT,(UCHAR *)szSqlState,&NativeError,(UCHAR *)szErrorMsg,255,&ErrorMsg);
throw (char *)szErrorMsg;
}
}mydbQry::~mydbQry()
{
SQLDisconnect(hdbc);
SQLFreeConnect(hdbc);
SQLFreeEnv(henv);
}
你在耍任吧?怎么大家跟了这么多,怎么一分都没有得到??
我也想接触数据库,但心里总害怕它!想想就怕!!!
你咋搞的?你是一个说话不算数的家伙吗?
to : leiennet(雷恩): 兄弟亚, 我都忙死了,给我点时间吧!
#include <iostream>
#include <vector>
#include <sqlplus.hh>using namespace std;
求你帮个忙, 我下了一个mysql++, 但是编译的时候有错, 错误如下:
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xutility(723) : see declaration of 'std::reverse_iterator'
d:\Workspace\Microsoft\mysql++\include\resiter1.hh(52) : see reference to class template instantiation 'const_subscript_container<OnType,ValueType,ReturnType,SizeType,DiffType>' being compiled求你指点指点, 我没有别的, 以分向谢!
我下了好几个版本, 都是, 哦, 对了, 我用的是vc.net, 有没有关系呀!
http://www.csdn.net/expert/topic/958/958578.xml?temp=.254986
http://www.csdn.net/expert/topic/958/958578.xml?temp=.254986
http://www.csdn.net/expert/topic/958/958179.xml?temp=.160351