DAO database library DLL
Introduction
------------------------------------------------------------------------------
I have noticed that working with DAO databases and recordsets can often be
tedious and time consuming. That is why I created this DAO database library.
My goal was to create a library to speed up coding time when working with DAO.
My library allows you to
a) quickly open database and recordset objects
b) close them quickly without worrying about memory
leaks
b) easily read and write from the database for given
data types
These functions are not intended to replace the given DAO functionality,
but rather to extend up them for speed of coding.
DLL Setup
------------------------------------------------------------------------------
1. Open the project and compile the DLL using "rebuild all",
it will create a .dll and .lib file for you in your release folder.
Client EXE Setup
------------------------------------------------------------------------------
1. In project -> settings -> link -> object libraries
include daolibrary.lib
2. In Release folder add daolibrary.dll
3. In project workspace add daolibrary.lib
4. Add dllHeader.h to project and following
lines in client .cpp file.
#include "dllHeader.h"
CDaoDB db; // database
CDaoRS rs; // recordset
------------------------------------------------------------------------------
------------------------------------------------------------------------------
CDaoDB Documentation
CDaoDB extends the CDaoDatabase class
------------------------------------------------------------------------------
bool CDaoDB::dbOpen(CString strFilePathName);
Opens connection to CDaoDatabase given a
database filename with path.
-----------------------------------------------------------------------------
bool CDaoDB::dbClose();
Closes the CDaoDatabase, deletes variables
to prevent memory leaking.
-----------------------------------------------------------------------------
CString CDaoDB::GetTableName(int tableNum);
Returns the name of a table based on
the table number.
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
CDaoRS Documentation
CDaoRS extends the CDaoRecordset class
------------------------------------------------------------------------------
bool CDaoRS::rsOpen(CString sql,CDaoDatabase* db);
Opens connection to CDaoRecordset given sql
and database.
i.e.
rs.rsOpen("SELECT * FROM TABLE",database.db);
*note that this opens the recordset as dbOpenDynaset
-----------------------------------------------------------------------------
bool CDaoRS::rsClose();
Closes the CDaoRecordset, deletes variables
to prevent memory leaking.
-----------------------------------------------------------------------------
double CDaoRS::GetAsDouble(int col);
Returns a double value from the specified
column in the recordset.
-----------------------------------------------------------------------------
int CDaoRS::GetAsInt(int col);
Returns an int value from the specified
column in the recordset.
-----------------------------------------------------------------------------
long CDaoRS::GetAsLong(int col);
Returns a long value from the specified
column in the recordset.
-----------------------------------------------------------------------------
CString CDaoRS::GetAsString(int col);
Returns a long value from the specified
column in the recordset.
-----------------------------------------------------------------------------
CString CDaoRS::GetDateAsString(int col);
Returns a date value in CString format from
the specified column in the recordset. The
CString will be returned with mm/dd/yyy format.
-----------------------------------------------------------------------------
CString CDaoRS::GetTimeAsString(int col);
Returns a date value in CString format from
the specified column in the recordset. The
CString will be returned with hh:mm:ss format.
-----------------------------------------------------------------------------
void CDaoRS::SetAsString(CString field,CString string);
Set specified fieldname field in recordset to
the CString value string.
-----------------------------------------------------------------------------
void CDaoRS::SetAsInt(CString field,int integer);
Set specified fieldname field in recordset to
the integer value int.
-----------------------------------------------------------------------------
void CDaoRS::SetAsLong(CString field,long lngValue);
Set specified fieldname field in recordset to
the long value lngValue.
-----------------------------------------------------------------------------
void CDaoRS::SetAsDouble(CString field,double dblValue);
Set specified fieldname field in recordset to
the double value dblValue.
-----------------------------------------------------------------------------
CString CDaoRS::GetFieldName(int col);
Returns the field name of the specified column
number in the recordset.
-----------------------------------------------------------------------------
int CDaoRS::GetRecordCount();
Returns the number of records in the
recordset.
没有合适的资源?快使用搜索试试~ 我知道了~
database-conn.rar_DEMO_databaseconn
共115个文件
h:38个
cpp:33个
ico:5个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 188 浏览量
2022-09-24
05:20:54
上传
评论
收藏 754KB RAR 举报
温馨提示
VC数据库连接代码,一个有10个文件夹演示代码,每一个文件夹内的都是采用不同的方法连接VC与数据库的演示,像通过ado连接数据库,dao连接数据库还有odbc连接数据库等,相信通过这些丰富的演示实例,你将学会如何使用VC++连接各种类型的数据库,你可下载源码后保存到你的资料库中,即使现在你用不上某种数据库的连接方式,但也可以放在那以后用得上了参考一下。演示截图为SerializeObjectIntoDBField_demo文件夹内的代码演示。
资源推荐
资源详情
资源评论
收起资源包目录
database-conn.rar_DEMO_databaseconn (115个子文件)
daolibrary.aps 18KB
Toolbar.bmp 1KB
Toolbar.bmp 594B
AdoTest.clw 5KB
SerObj.clw 4KB
daolibrary.clw 156B
ado2.cpp 49KB
ODBCRecordset.cpp 27KB
ADOImageDBDlg.cpp 11KB
AdoTestView.cpp 7KB
MainFrm.cpp 6KB
AdoTest.cpp 6KB
SerObjDoc.cpp 6KB
dllHeader.cpp 5KB
SerObj.cpp 5KB
RADatabase.cpp 5KB
Dyndb.cpp 4KB
Dyndb.cpp 4KB
CntrItem.cpp 4KB
ImageCtrl.cpp 3KB
SerObjView.cpp 3KB
AdoTestDoc.cpp 3KB
MainFrm.cpp 2KB
ADOImageDB.cpp 2KB
oledb2.cpp 2KB
ByteArrayFile.cpp 2KB
ByteArrayFile.cpp 2KB
ChildFrm.cpp 2KB
daolibrary.cpp 2KB
ReportRec.cpp 1KB
CntrItem.cpp 1KB
DlgNew.cpp 1002B
DynRec.cpp 620B
DynRec.cpp 606B
MTDaoRecordset.cpp 478B
StdAfx.cpp 212B
stdafx.cpp 210B
StdAfx.cpp 209B
StdAfx.cpp 208B
daolibrary.def 196B
FreeImage.dll 648KB
SerObj.dsp 5KB
AdoTest.dsp 5KB
daolibrary.dsp 3KB
daolibrary.dsw 543B
AdoTest.dsw 537B
SerObj.dsw 535B
FreeImage.h 34KB
MTDaoRecordset.h 20KB
ado2.h 19KB
ODBCRecordset.h 12KB
oledb2.h 3KB
AdoTestView.h 3KB
stdafx.h 2KB
SerObjView.h 2KB
CntrItem.h 2KB
SerObjDoc.h 2KB
AdoTest.h 2KB
MainFrm.h 2KB
CntrItem.h 2KB
StdAfx.h 1KB
MainFrm.h 1KB
AdoTestDoc.h 1KB
ChildFrm.h 1KB
ADOImageDBDlg.h 1KB
StdAfx.h 1KB
StdAfx.h 1KB
SerObj.h 1KB
ReportRec.h 1KB
DlgNew.h 1KB
Dyndb.h 1KB
Dyndb.h 1KB
resource.h 1KB
dllHeader.h 1007B
resource.h 957B
ByteArrayFile.h 927B
ByteArrayFile.h 927B
RADatabase.h 925B
resource.h 866B
ImageCtrl.h 761B
ADOImageDB.h 548B
DynRec.h 537B
DynRec.h 537B
Resource.h 382B
AdoWrapper.h 123B
ODBCRecordset.htm 28KB
ADOImageDB.ico 21KB
SerObjDoc.ico 1KB
SerObj.ico 1KB
AdoTestDoc.ico 1KB
AdoTest.ico 1KB
FreeImage.lib 41KB
ADOImageDB.manifest 700B
dbimage.mdb 1.46MB
Reports.mdb 426KB
AdoTest.opt 53KB
SerObj.rc 16KB
AdoTest.rc 15KB
ADOImageDB.rc 6KB
daolibrary.rc 3KB
共 115 条
- 1
- 2
资源评论
Kinonoyomeo
- 粉丝: 74
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功