資源簡(jiǎn)介
這是一個(gè)打包了的sqlite3的庫(kù)文件,里面有sqlite3的源碼和.def,.lib等文件,可以直接下載,解壓,添加到你的MFC工程里面,然后包含這個(gè)庫(kù)的路徑,就可以用MFC操作sqlite3這個(gè)數(shù)據(jù)庫(kù)了。
代碼片段和文件信息
////////////////////////////////////////////////////////////////////////////////
//?CppSQLite3?-?A?C++?wrapper?around?the?SQLite3?embedded?database?library.
//
//?Copyright?(c)?2004?Rob?Groves.?All?Rights?Reserved.?rob.groves@btinternet.com
//?
//?Permission?to?use?copy?modify?and?distribute?this?software?and?its
//?documentation?for?any?purpose?without?fee?and?without?a?written
//?agreement?is?hereby?granted?provided?that?the?above?copyright?notice?
//?this?paragraph?and?the?following?two?paragraphs?appear?in?all?copies?
//?modifications?and?distributions.
//
//?IN?NO?EVENT?SHALL?THE?AUTHOR?BE?LIABLE?TO?ANY?PARTY?FOR?DIRECT
//?INDIRECT?SPECIAL?INCIDENTAL?OR?CONSEQUENTIAL?DAMAGES?INCLUDING?LOST
//?PROFITS?ARISING?OUT?OF?THE?USE?OF?THIS?SOFTWARE?AND?ITS?DOCUMENTATION
//?EVEN?IF?THE?AUTHOR?HAS?BEEN?ADVISED?OF?THE?POSSIBILITY?OF?SUCH?DAMAGE.
//
//?THE?AUTHOR?SPECIFICALLY?DISCLAIMS?ANY?WARRANTIES?INCLUDING?BUT?NOT
//?LIMITED?TO?THE?IMPLIED?WARRANTIES?OF?MERCHANTABILITY?AND?FITNESS?FOR?A
//?PARTICULAR?PURPOSE.?THE?SOFTWARE?AND?ACCOMPANYING?DOCUMENTATION?IF
//?ANY?PROVIDED?HEREUNDER?IS?PROVIDED?“AS?IS“.?THE?AUTHOR?HAS?NO?OBLIGATION
//?TO?PROVIDE?MAINTENANCE?SUPPORT?UPDATES?ENHANCEMENTS?OR?MODIFICATIONS.
//
//?V3.0 03/08/2004 -Initial?Version?for?sqlite3
//
//?V3.1 16/09/2004 -Implemented?getXXXXField?using?sqlite3?functions
// -Added?CppSQLiteDB3::tableExists()
////////////////////////////////////////////////////////////////////////////////
#include?“StdAfx.h“
#include?“CppSQLite3.h“
#include?
//?Named?constant?for?passing?to?CppSQLite3Exception?when?passing?it?a?string
//?that?cannot?be?deleted.
static?const?bool?DONT_DELETE_MSG=false;
////////////////////////////////////////////////////////////////////////////////
//?Prototypes?for?SQLite?functions?not?included?in?SQLite?DLL?but?copied?below
//?from?SQLite?encode.c
////////////////////////////////////////////////////////////////////////////////
int?sqlite3_encode_binary(const?unsigned?char?*in?int?n?unsigned?char?*out);
int?sqlite3_decode_binary(const?unsigned?char?*in?unsigned?char?*out);
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
CppSQLite3Exception::CppSQLite3Exception(const?int?nErrCode
char*?szErrMess
bool?bDeleteMsg/*=true*/)?:
mnErrCode(nErrCode)
{
mpszErrMess?=?sqlite3_mprintf(“%s[%d]:?%s“
errorCodeAsString(nErrCode)
nErrCode
szErrMess???szErrMess?:?““);
if?(bDeleteMsg?&&?szErrMess)
{
sqlite3_free(szErrMess);
}
}
CppSQLite3Exception::CppSQLite3Exception(const?CppSQLite3Exception&??e)?:
mnErrCode(e.mnErrCode)
{
mpszErrMess?=?0;
if?(e.mpszErrMess)
{
mpszErrMess?=?sqlite3_mprintf(“%s“?e.mpszErrMess);
}
}
const?char*?CppSQLite3Exception::errorCodeAsString(int?nErrC
評(píng)論
共有 條評(píng)論