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

SQL Anywhere 11.0.1 (中文) » UltraLite - C 及 C++ 编程 » 应用程序开发 » 使用嵌入式 SQL 开发应用程序 » 向应用程序添加同步

 

处理同步通信错误

以下代码说明了如何从嵌入式 SQL 应用程序中处理通信错误:

if( psqlca->sqlcode == SQLE_COMMUNICATIONS_ERROR ) {
     printf( "  Stream error information:\n"
             "    stream_error_code = %ld\t(ss_error_code)\n"
             "    error_string      = \"%s\"\n"
             "    system_error_code = %ld\n",
     (long)info.stream_error.stream_error_code,
     info.stream_error.error_string,
     (long)info.stream_error.system_error_code );

SQLE_COMMUNICATIONS_ERROR 是通信错误的一般错误代码。在 stream_error 同步参数的成员中为应用程序提供了更多有关特定错误的信息。

为使 UltraLite 较小,运行库报告数字而不是报告消息。