Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 (中文) » SQL Anywhere 服务器 - 编程 » SQL Anywhere 数据访问 API » SQL Anywhere C API 参考 » sacapi.h

 

sqlany_init 函数

初始化接口。

语法
sacapi_bool sqlany_init( const char * app_name, sacapi_u32 api_version, sacapi_u32 * version_available )
参数
  • app_name   由 sqlany_execute 或 sqlany_execute_direct 执行的语句对象。

  • api_version   已编译应用程序的版本(使用 SQLANY_CURRENT_API_VERSION)。

  • version_available   最大的支持 API 版本。

返回值

成功则为 1,否则为 0。

另请参见
示例
SQLAnywhereInterface  api;
a_sqlany_connection   *conn;
unsigned int          max_api_ver;

if( !sqlany_initialize_interface( &api, NULL ) ) {
    printf( "Could not initialize the interface!\n" );
    exit( 0 );
}

if( !api.sqlany_init( "MyAPP", SQLANY_CURRENT_API_VERSION, &max_api_ver )) {
    printf( "Failed to initialize the interface! Supported version = %d\n", max_api_ver );
    sqlany_finalize_interface( &api );
    return -1;
}