Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.
初始化 SQLAnywhereInterface 对象并动态装载 DLL。
public int sqlany_initialize_interface( SQLAnywhereInterface * api, const char * optional_path_to_dll )
api 要初始化的 API 结构。
optional_path_to_dll 用于指定到 SQL Anywhere C API DLL 的路径的可选参数。
成功初始化则为 1,失败则为 0。
使用以下语句来包括函数原型:
#include "sacapidll.h"
此函数尝试动态装载 SQL Anywhere C API DLL 并查找 DLL 的所有入口点。填充 SQLAnywhereInterface 结构的字段时应指向 DLL 中的相应函数。如果可选路径参数为 NULL,则检查环境变量 SQLANY_DLL_PATH。如果已设置该变量,则库会尝试装载由该环境变量指定的 DLL。如果上述方法失败,则接口将尝试直接装载 DLL(这依赖于环境设置是否正确)。
可以在 SQL Anywhere 安装位置下的 sdk\dbcapi\examples 目录中的 C API 示例中找到 sqlany_initialize_interface 方法使用示例。