sprintf(sqls,"dasi_insert %d,'%s %d:%d',%d,%d",vid,buf,hour,minu,ival,fread(&hour,1,1,fp);fread(&minu,1,1,fp);fread(&ival,2,1,fp);fread(&flags,2,1,fp);sprintf(sqls,"%sdasi_insert %d,'%s %d:%d',%d,%d",hisdb,vid,buf,hour,minu,ival,flags);SQLExecDirect(

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/15 18:45:26
sprintf(sqls,
xSkPWUEWeO%6 hƲm8kڢЍFcq̽7ؗԌtO#!;=KTaU] gi۲EMpZ0r"/NX@Y f5,w44<6<Zc7Ǥ4O@-5=W;x.˚I-rC` bKc7'K!oԷl%{(&5D5WQ'gV36W+!_9b/sqF˝?߉־WeZ:qg-D{yzf@ lΗh!O _&s/F گ.jƔ<+n5%❿ýV@3tƯ{$V ra1QEĚtP OE?tˠݚm`A>\ Rn֯ωUط0`s@9vR5rf,W~>`WbPR

sprintf(sqls,"dasi_insert %d,'%s %d:%d',%d,%d",vid,buf,hour,minu,ival,fread(&hour,1,1,fp);fread(&minu,1,1,fp);fread(&ival,2,1,fp);fread(&flags,2,1,fp);sprintf(sqls,"%sdasi_insert %d,'%s %d:%d',%d,%d",hisdb,vid,buf,hour,minu,ival,flags);SQLExecDirect(
sprintf(sqls,"dasi_insert %d,'%s %d:%d',%d,%d",vid,buf,hour,minu,ival,
fread(&hour,1,1,fp);
fread(&minu,1,1,fp);
fread(&ival,2,1,fp);
fread(&flags,2,1,fp);
sprintf(sqls,"%sdasi_insert %d,'%s %d:%d',%d,%d",hisdb,vid,buf,hour,minu,ival,flags);
SQLExecDirect(hstmt,(BYTE*)sqls,SQL_NTS);
SQLFreeStmt(hstmt,SQL_CLOSE);

sprintf(sqls,"dasi_insert %d,'%s %d:%d',%d,%d",vid,buf,hour,minu,ival,fread(&hour,1,1,fp);fread(&minu,1,1,fp);fread(&ival,2,1,fp);fread(&flags,2,1,fp);sprintf(sqls,"%sdasi_insert %d,'%s %d:%d',%d,%d",hisdb,vid,buf,hour,minu,ival,flags);SQLExecDirect(
这个是ODBC API操作数据库的一组语句.
sprintf(sqls,"%sdasi_insert %d,'%s %d:%d',%d,%d",hisdb,vid,buf,hour,minu,ival,flags);
这个是格式化sqls的操作,将后面的参数hisdb,vid,buf,hour,minu,ival,flagsf分别格式化%sdasi_insert %d,'%s %d:%d',%d,%d中,buf,hour,minu对应的是'%s %d:%d'里面的.
SQLExecDirect(hstmt,(BYTE*)sqls,SQL_NTS); //这个是执行sql语句
SQLFreeStmt(hstmt,SQL_CLOSE); //这个是释放sql句柄.
ODBC API你可以晚上搜一下,有很多示例的.微软官网msdn上面也有API的具体用法.这样的资料很多的,你一看就知道了.