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

SQL Anywhere 11.0.1 (Français) » SQL Anywhere Server - Programming » SQL Anywhere Data Access APIs » SQL Anywhere C API reference » sacapi.h


sqlany_init function

Initializes the interface.

sacapi_bool sqlany_init( const char * app_name, sacapi_u32 api_version, sacapi_u32 * version_available )
  • app_name   A statement object executed by sqlany_execute or sqlany_execute_direct.

  • api_version   The version of the compiled application (use SQLANY_CURRENT_API_VERSION).

  • version_available   The maximum supported API version.


1 on success, 0 otherwise

See also
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;