dao_extension

所属分类:中间件编程
开发工具:Visual C++
文件大小:30KB
下载次数:2
上传日期:2011-09-21 11:31:13
上 传 者houcy
说明:  很好的输入资料,老外写的,很牛逼,希望大家喜欢
(Good input data, a foreigner writing, it is 牛逼, hope you like)

文件列表:
dao extension\Release (0, 2002-03-01)
dao extension\daolibrary.plg (2190, 2002-03-05)
dao extension\daolibrary.clw (156, 2002-02-28)
dao extension\daolibrary.dsw (543, 2002-02-28)
dao extension\daolibrary.cpp (1584, 2002-03-01)
dao extension\daolibrary.def (196, 2002-02-28)
dao extension\StdAfx.h (1535, 2002-03-01)
dao extension\StdAfx.cpp (212, 2002-02-28)
dao extension\Resource.h (382, 2002-02-28)
dao extension\daolibrary.rc (3078, 2002-02-28)
dao extension\daolibrary.dsp (3104, 2002-03-01)
dao extension\dllHeader.h (1007, 2002-03-05)
dao extension\res (0, 2002-03-01)
dao extension\res\daolibrary.rc2 (402, 2002-02-28)
dao extension\daolibrary.opt (48640, 2002-03-05)
dao extension\daolibrary.ncb (91136, 2002-03-05)
dao extension\dllHeader.cpp (5429, 2002-03-05)
dao extension\daolibrary.aps (18000, 2002-03-01)
dao extension (0, 2002-03-01)

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.

近期下载者

相关文件


收藏者