⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 csqldriver.cpp

📁 很好用的数据库连接组件
💻 CPP
字号:
#include "stdafx.h"#include "CSqlDriver.h"// database states#define DBState_Open		0x0001#define DBState_OpenError	0x0002CSqlDriver :: CSqlDriver():dbState(0),error(){}CSqlDriver ::~CSqlDriver(){}bool CSqlDriver :: isOpen()const {        return((dbState&DBState_Open)==DBState_Open);}/*!    Returns TRUE if the there was an error opening the database    connection; otherwise returns FALSE.*/bool CSqlDriver :: isOpenError()const {    return((dbState&DBState_OpenError)==DBState_OpenError);}/*!    Protected function which sets the open state of the database to \a    o. Derived classes can use this function to report the status of    open().    \sa open(), setOpenError()*/void CSqlDriver :: setOpen(bool o){    if(o)    dbState|=DBState_Open ;    else     dbState&=~DBState_Open ;}/*!    Protected function which sets the open error state of the database    to \a e. Derived classes can use this function to report the    status of open(). Note that if \a e is TRUE the open state of the    database is set to closed (i.e. isOpen() returns FALSE).    \sa open(), setOpenError()*/void CSqlDriver :: setOpenError(bool e){    if(e)    {        dbState|=DBState_OpenError ;        dbState&=~DBState_Open ;    }    else     dbState&=~DBState_OpenError ;}/*!    Protected function which allows derived classes to set the value    of the last error, \a e, that occurred on the database.    \sa lastError()*/void CSqlDriver :: setLastError(const CSqlError&e){    error=e ;}/*!    Returns a CSqlError object which contains information about the    last error that occurred on the database.*/CSqlError CSqlDriver :: lastError()const {    return error ;}/*!    Returns a string representation of the NULL value for the    database. This is used, for example, when constructing INSERT and    UPDATE statements. The default implementation returns the string    "NULL".*/string CSqlDriver :: nullText()const {    return "NULL" ;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -