7 数据库函数

1 连接数据库

            handle dbConnect(string cnnString)
        

cnnString:连接字符串,返回值:数据库连接句柄

2 连接ODBC数据库

            handle dbConnect (string driverName, string databaseName,
                string user, string password)
        

driverName:驱动名,databaseName:数据库名,user:用户名,password:密码

3 关闭数据库连接

            void dbClose(handle hCnn)
        

hCnn:数据库连接句柄

4 打开表记录集

            handle dbOpenRecordSet(handle cnn, string tableName)
        

ableName:表名,返回值:记录集句柄

5 关闭记录集

            void dbCloseRecordSet(handle record)
        

record:记录集句柄

6 查找第一条记录

            bool dbFindFirst(handle record, string strFilter)
        

strFilter:查找选项

7 设置节点的碰撞属性

            void setFieldCollision(string fieldPath, bool bCollision)
        

8 查找下一条记录

            bool dbFindNext(handle record, string strFilter)
        

9 移动到第一条记录

            bool dbMoveFirst(handle record)
        

10 移动到下一条记录

            bool dbMoveNext(handle record)
        

11 运行SQL语句

            void dbExecuteSQL(handle record, string strSQL)
        

12 判断记录集是否位于首部

            bool dbIsBOF(handle record)
        

13 判断记录集是否位于尾部

            bool dbIsEOF(handle record)
        

14 开始添加记录

            bool dbAddNew(handle record)
        

15 删除当前记录

            bool dbDelete(handle record)
        

16 更新当前记录

            bool dbUpdate(handle record)
        

17 获得记录集的条数

            bool dbGetRecordCount(handle record)
        

18 获取字符串字段内容

            bool dbGetString(handle record, string fieldName, string& str)
        

19 写入字符串字段内容

            bool dbSetString(handle record, string fieldName, string& str)
        

20 获取long字段内容

            bool dbGetLong(handle record, string fieldName, long& lVal)
        

21 写入long字段内容

            bool dbSetLong(handle record, string fieldName, long& lVal)
        

22 获取dword数组内容

            bool dbGetBits(handle record, string fieldName,
                dword& buffer, long& count)
        

23 写入dword数组内容

            bool dbSetBits(handle record, string fieldName,
                dword& buffer, long& count)
        

24 获取float字段内容

            bool dbGetFloat(handle record, string ieldName, float& lVal)
        

25 写入float字段内容

            bool dbSetFloat(handle record, string ieldName, float& lVal)
        

26 获取时间字段内容

            bool dbGetTime(handle record, string fieldName,
                int& year, int& month, int& day,
                int& hour, int& minute, int& second)
        

27 写入时间字段内容

            bool dbSetTime(handle record, string fieldName,
                int& year, int& month, int& day,
                int& hour, int& minute, int& second)
        

28 连接mysql数据库

            handle mysqlConnect(string szHost, int uPort,
                string szDbName, string szUser, string szPawd)
        

29 执行mysql语句

            bool mysqlExecuteSQL(handle database,
                string strSQL, string callback)
        

callback:用户自定义的回调函数名

30 关闭mysql数据库连接

            void mysqlClose(handle database)