日期:2011-04-09  浏览次数:20458 次


理论上,使用标准的 ODBC 会比使用本函数好。当然也可以使用本函数,只是较不鼓励 Solid 函数库。


solid_close: 关闭 solid 链接。
solid_connect: 链接至 solid 数据库。
solid_exec: 执行 SQL 指令。
solid_fetchrow: 取得返回一列。
solid_fieldname: 取得字段名称。
solid_fieldnum: 取得字段数目。
solid_freeresult: 释出返回资料的内存。
solid_numfields: 取得字段数目。
solid_numrows: 取得返回列数目。
solid_result: 取得返回资料。

solid_close
关闭 solid 链接。
语法: void solid_close(int connection_id);
返回值: 无
函数种类: 数据库功能
内容说明: 本函数用来关闭与 solid 数据库之间的链接。参数 connection_id 为 solid 链接代号 ID 值。若正在执行 transactions 则无法关闭链接。

solid_connect
链接至 solid 数据库。
语法: int solid_connect(string dsn, string user, string password, int [cursor_type]);
返回值: 整数
函数种类: 数据库功能
内容说明: 本函数用来链接到 solid 数据库,返回值为链接的代号 ID 值。参数 dsn 为资料来源名称 (Data Sources Name)。参数 user 及 password 分别为链接的帐号及密码。参数 cursor_type 通常省略,其值有 SQL_CUR_USE_IF_NEEDED、SQL_CUR_USE_ODBC、SQL_CUR_USE_DRIVER 及 SQL_CUR_DEFAULT 等四种。当使用复杂的资料存取时可能会有类似 "Cannot open a cursor on a stored procedure that has anything other than a single select statement in it" 的错误信息字符串,此时若将参数 cursor_type 的值设为 SQL_CUR_USE_ODBC 就可以避开了。

solid_exec
执行 SQL 指令。
语法: int solid_exec(int connection_id, string query);
返回值: 整数
函数种类: 数据库功能
内容说明: 本函数用来执行 SQL 的 query 指令。参数 connection_id 为 ODBC 链接代号 ID 值。参数 query 则为欲执行的指令。返回值为 Result ID 值。

solid_fetchrow
取得返回一列。
语法: int solid_fetchrow(int result_id, int [row_number]);
返回值: 整数
函数种类: 数据库功能
内容说明: 本函数用来取得 Query 的返回资料的一列。参数 result_id 为 ODBC 返回 ID 值。参数 rownumber 可省略,为指定的取得列 (row)。

solid_fieldname
取得字段名称。
语法: string solid_fieldname(int result_id, int field_number);
返回值: 字符串
函数种类: 数据库功能
内容说明: 本函数用来取得 Query 的返回资料的字段名称。参数 result_id 为 solid 返回 ID 值。参数 field_number 为指定的字段,起始值为 1。

solid_fieldnum
取得字段数目。
语法: int solid_fieldnum(int result_id);
返回值: 整数
函数种类: 数据库功能
内容说明: 本函数用来取得返回资料的字段数目。参数 result_id 为 solid 返回 ID 值。若发生错误则返回 -1。

solid_freeresult
释出返回资料的内存。
语法: int solid_freeresult(int result_id);
返回值: 整数
函数种类: 数据库功能
内容说明: 本函数可用来释出返回资料所使用的内存,通常在系统内存资源不足的情形下才需要使用。参数 result_id 为 solid 返回 ID 值。返回值永远都是 true。

solid_numfields
取得字段数目。
语法: int solid_numfields(int result_id);
返回值: 整数
函数种类: 数据库功能
内容说明: 本函数用来取得返回资料的字段数目。参数 result_id 为 solid 返回 ID 值。若发生错误则返回 -1。

solid_numrows
取得返回列数目。
语法: int solid_numrows(int result_id);
返回值: 整数
函数种类: 数据库功能
内容说明: 本函数用来取得返回列的数目。参数 result_id 为 solid 返回 ID 值。若有错误发生则返回