C++与数据库的连接?
来源:百度知道 编辑:UC知道 时间:2024/06/06 19:58:11
评论 ┆ 举报
最佳答案此答案由提问者自己选择,并不代表百度知道知识人的观点
回答:zb1980524
新手
4月17日 16:53 附一源码
CWinApp theApp;
using namespace std;
CHmbAdoDBRs RfRst;
CString sSql;
CString seq, body, eng, tm, tl, icol, ecol, alc, bhmcdate;
int i;
BOOL DbOpen();
BOOL CkseqtmpSelect();
BOOL CkseqtmpUpdate();
int PrintStatus();
int SockInit();
CHmbAdoDB Sqldb;
int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
int cnt = 0;
int nRetCode = 0;
int page = 1;
int prt_ret;
CString strDate, strTime;
// initialize MFC and print and error on failure
if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
{
// TODO: change error code to suit your needs
cerr << _T("Fatal Error: MFC initialization failed") << endl;
nRetCode = 1;
}
//DataBase Open...
if(DbOpen()) cout << "DataBase Op