//查询数据库
dbcmd(dbprocess, "select ID,BeginTime,Description from Alarms");
if(dbsqlexec(dbprocess) == FAIL){
printf("ASB>> Query Alarms table error\n");
}
DBINT result_code;
char szID[1024];
char szBeginTime[1024];
char szDescription[1024];
int rows = 0;
while ((result_code = dbresults(dbprocess)) != NO_MORE_RESULTS){
if (result_code == SUCCEED){
dbbind(dbprocess, 1, CHARBIND, (DBINT)0, (BYTE*)szID);
dbbind(dbprocess, 2, CHARBIND, (DBCHAR)0, (BYTE*)szBeginTime);
dbbind(dbprocess, 3, CHARBIND, (DBCHAR)0, (BYTE*)szDescription);
while (dbnextrow(dbprocess) != NO_MORE_ROWS){
printf("ASB>> ID=%s\n", szID);
printf("ASB>> szAid=%s\n", szBeginTime);
printf("ASB>> szBeginTime=%s\n", szDescription);
}
}
}
//关闭数据库连接
dbclose(dbprocess);
dbloginfree(loginrec);
dbexit();
usleep(1000);
}
return 0;
}