|
lrd_open_context(&Ctx2, LRD_DBTYPE_ODBC, 0, 0, 0);
lrd_open_context(&Ctx3, LRD_DBTYPE_ODBC, 0, 0, 0);
lrd_db_option(0, OT_ODBC_CP_OFF, 0, 0);
lrd_alloc_connection(&Con2, LRD_DBTYPE_ODBC, Ctx3, 0 /*Unused*/, 0);
lrd_db_option(Con2, OT_ODBC_LOGIN_TIMEOUT, (void FAR const *)15, 0);
lrd_open_connection(&Con2, LRD_DBTYPE_ODBC, "", "", "", "DATABASE= ;DSN= ;OPTION= ;PWD="
;PORT=0;SERVER=;UID=", Ctx3, 1, 0);
lrd_open_cursor(&Csr1, Con2, 0);
lrd_db_option(Csr1, OT_ODBC_SS_HIDDEN_COLUMNS, "ON", 0);
lrd_db_option(Csr1, OT_ODBC_QUERY_TIMEOUT, (void FAR const *)30, 0);
lrd_stmt(Csr1, "SQL语句", -1, 1 /*Direct exec*/, 0 /*None*/, 0);
lrd_db_option(Csr1, OT_ODBC_RETRIEVE_DATA, "OFF", 0);
lrd_db_option(Csr1, OT_ODBC_RETRIEVE_DATA, "ON", 0);
lrd_bind_cols(Csr1, BCInfo_D2, 0);
lr_start_transaction("MercuryFetch_0");
lrd_fetchx(Csr1, -4393, 1, 0, PrintRow2, 1, 0);
GRID(2);
lr_end_transaction("MercuryFetch_0", LR_AUTO);
lr_think_time(14);
lrd_db_option(Csr1, OT_ODBC_CURSOR_UNBOUNDCOLS, 0, 0);
lrd_result_set(Csr1, 0, 0, 0);
lrd_db_option(Csr1, OT_ODBC_CURSOR_CLOSE, 0, 0); |
|