信息窗口提示如下
if (var==1)
{
\\本站点\DB_DESC=name;
\\本站点\DB_START=\\本站点\$日期+" "+\\本站点\$时间;
\\本站点\DB_END=" ";
\\本站点\DB_LENGTH=" ";
SQLInsert( DeviceID, "DeviceInfo", "BIND" );//向数据中,插入一条记录
}
else
{
string whrStr="描述='"+name+"' and 结束时间='" + " '" ;
string selStr="select * from DeviceInfo where " + whrStr;
SQLSetStatement( DeviceID, selStr);
SQLExecute( DeviceID, "BIND",0 );
string startStr = \\本站点\DB_START;
string midY=StrMid ( startStr, 1, 4 );
string midM=StrMid ( startStr, 6, 2 );
string midD=StrMid ( startStr, 9, 2 );
string midH=StrMid ( startStr, 12, 2 );
string midMi=StrMid ( startStr, 15, 2 );
string midS=StrMid ( startStr, 18, 2 );
long lY=StrToInt ( midY);
long lM=StrToInt ( midM);
long lD=StrToInt ( midD);
long lH=StrToInt ( midH);
long lMi=StrToInt ( midMi);
long lS=StrToInt ( midS);
long startTime= HTConvertTime (lY,lM,lD,lH,lMi,lS);
long endTime= HTConvertTime (\\本站点\$年,\\本站点\$月,\\本站点\$日,\\本站点\$时,\\本站点\$分,\\本站点\$秒);/
long timeLength=endTime-startTime;
string endStr=StrFromInt ( timeLength, 10 )+"秒";
\\本站点\DB_END=\\本站点\$日期+" "+\\本站点\$时间;
\\本站点\DB_LENGTH=endStr;
SQLUpdate( DeviceID, "DeviceInfo", "BIND", whrStr);
}
楼主最近还看过