access数据库查询时间的问题,郁闷!!!!!!!!!!!!!
moyue 2003-04-08 12:07:42 代码如下:
dmmanage.ccConnection.Connected:=true; //ccConnectio是dcomconnection.
sDate:='#'+formatdatetime('mm/dd/yyyy',now)+' 00:00:01'+'#';
sDateEnd:='#'+formatdatetime('mm/dd/yyyy hh:nn:ss',now)+'#';
sSql:='select * from customer where (cometime>='+sdate+')'+' and '+'(cometime<='+sDateEnd+')';
dmmanage.cdsmanage.Close;
dmmanage.cdsmanage.CommandText:=sSql;
dmmanage.cdsmanage.Open;
出现的错误是:project bathmanage.exe raised exception class EoleException with message '变量或者类型不正确,或者不在可以接受的范围内,要不就是与其他数据冲突。’
sdate、sdateend、ssql都是string变量,同样的sql语句在access中是成功的,而程序中确出错,郁闷!!!!!