力控组态软件ForceControl V7.0后台组件Ado组件的控件方法5
OpenDataBase()
描述: 打开数据库
返回值: int 0- 失败 1- 成功
参数: 无
说明: 执行完脚本数据库打开
示例: #ADOModule.OpenDataBase();// 打开数据库
关联方法: CloseDataBase,DatabaseIsOpen
OpenRecordSet(string SQLStr)
描述: 通过指定 SQL 打开记录集
返回值: int 0- 失败 1- 成功
参数: SQLStr-SQL 查询字符串
说明: 打开记录集 , 有数据过滤功能
示例: #ADOModule.OpenRecordSet(“select * from table1”);// 打开对应记录集
关联方法: RecordsetIsOpen,ExcuteSQL,CloseRecordset
PutValueByFieldDouble(string Field,double Value)
函数描述: 按照字段名称设定数据
返回值: int 0- 失败 1- 成功
参数: Field- 字段名称
Value- 设定的数据
说明: 按照字段名称设置浮点型数据
示例: #ADOModule.PutValueByFieldDouble(“Field1”,11.1);// 设定字段名称为 Field1 的数据为 11.1
关联方法: GetValueByIndexDouble,GetValueByFieldDouble
PutValueByFieldFile(string Field,string FileName)
函数描述: 按照字段名称设定数据
返回值: int 0- 失败 1- 成功
参数: Field- 字段名称
FileName- 文件名称
说明: 按照字段名称从文件导入数据
示例: #ADOModule.PutValueByFieldFile(0,#ADOModule.FilePath);// 设定字段 Field1 数据为指定文件路径的数据
关联方法: GetValueByIndexFile,GetValueByFieldFile
PutValueByFieldInt(string Field,int Value)
描述: 按照字段名称设定数据
返回值: int 0- 失败 1- 成功
参数: Field- 字段名称
Value- 设定的数据
说明: 按照字段名称设置整型数据
示例: #ADOModule.PutValueByFieldInt(“Field1”,11);// 设定字段名称为 Field1 的数据为 11
关联方法: GetValueByIndexInt,GetValueByFieldInt
PutValueByFieldStr(string Field,string Value)
描述: 按照字段名称设定数据
返回值: int 0- 失败 1- 成功
参数: Field- 字段名称
Value- 设定的数据
说明: 按照字段名称设置字符型数据
示例: ADOModule.PutValueByFieldStr(“Field1″,” 一 “);// 设定字段名称为 Field1 的数据为 ” 一 “
关联方法: GetValueByIndexStr,GetValueByFieldStr
PutValueByFieldTime(string Field,int Value)
描述: 按照字段名称设定数据
返回值: int 0- 失败 1- 成功
参数: Field- 字段名称
Value- 设定的数据
说明: 按照字段名称设置时间型数据
示例: #ADOModule.PutValueByFieldTime(“Field1”,LongTime(“2007/7/56 16:5:54”));// 设定字段 Field1 数据为 2007/7/56 16:5:54
关联方法: GetValueByIndexTime,GetValueByFieldTime
PutValueByIndexDouble(int Index,double Value)
描述: 按照字段索引位置设定数据
返回值: int 0- 失败 1- 成功
参数: Index- 字段索引位置
Value- 设定的数据
说明: 按照字段索引位置设置浮点型数据
示例: #ADOModule.PutValueByIndexDouble(0,11.1);// 设定字段索引为 0 的位置数据为 11.1
关联方法: GetValueByIndexDouble,GetValueByFieldDouble
PutValueByIndexFile(int Index,string FileName)
描述: 按照字段索引位置设定数据
返回值: int 0- 失败 1- 成功
参数: Index- 字段索引位置
FileName- 文件名称
说明: 按照字段索引位置将文件导入
示例: #ADOModule.PutValueByIndexFile(0,#ADOModule.FilePath);// 设定字段索引为 0的位置数据为指定文件路径的数据
关联方法: GetValueByIndexFile,GetValueByFieldFile
PutValueByIndexInt(int Index,int Value)
描述: 按照字段索引位置设定数据
返回值: int 0- 失败 1- 成功
参数: Index- 字段索引位置
Value- 设定的数据
说明: 按照字段索引位置设置整型数据
示例: #ADOModule.PutValueByIndexInt(0,11);// 设定字段索引为 0 的位置数据为 11
关联方法: GetValueByIndexInt,GetValueByFieldInt
PutValueByIndexStr(int Index,string Value)
描述: 按照字段索引位置设定数据
返回值: int 0- 失败 1- 成功
参数: Index- 字段索引位置
Value- 设定的数据
说明: 按照字段索引位置设置字符型数据
示例: #ADOModule.PutValueByIndexStr(0,” 一 “);// 设定字段索引为 0 的位置数据为 ” 一 “
关联方法: GetValueByIndexStr,GetValueByFieldStr
PutValueByIndexTime(int Index,int Value)
描述: 按照字段索引位置设定数据
返回值: int 0- 失败 1- 成功
参数: Index- 字段索引位置
Value- 设定的数据
说明: 按照字段索引位置设置时间型数据
示例: #ADOModule.PutValueByIndexTime(0,LongTime(“2007/7/56 16:5:54”));// 设定字段索引为 0 的位置数据为 2007/7/56 16:5:54
关联方法: GetValueByIndexTime,GetValueByFieldTime