W
wyismail
Unregistered / Unconfirmed
GUEST, unregistred user!
CMeetReseanStr='select count(*) as t from meettable m ,eventproperty ep ,eventreason er'+
' where m.reasoncode = er.reasoncode and m.eventprocode = ep.eventprocode'+
' and ep.name = ropertyname and er.name = :resonname'+
' and m.catchtime >=: StartDate and m.catchtime <: EndDate';
function TStatisticsQueryFrm.DoSelect(ParRow,ParLine: string): integer;
var
Query:TADOQuery;
TemStr:String;
begin
Query:=TADOQuery.Create(self);
Try
Query.Connection :=DbModule.ADOConnection1 ;
Query.SQL.Text :=CMeetReseanStr;
With query.Parameters do
begin
CreateParameter('propertyname',ftString,pdInputOutput , 20, 0);
CreateParameter('resonname',ftString,pdInputOutput , 20, 0);
CreateParameter('StartDate',ftDateTime,pdInputOutput , 0, 0);
CreateParameter('Enddate',ftDateTime,pdInputOutput , 0, 0);
end;
Query.Parameters.ParamByName('propertyname').value:=ParRow;
Query.Parameters.ParamByName('resonname').value:=ParLine;
Query.Parameters.ParamByName('StartDate').value:=StartDate;
Query.Parameters.ParamByName('Enddate').value:=Enddate;
// Query.AfterClose :=self.QueryAfterClose;
TemStr:=Query.SQL.Text; //这里设置断点,但显示参数的值并没有传过来还是原来的值
Query.Open;
Result:=Query.Fields[0].asinteger;
Except
Query.Free;
Result:=0;
end;
end;
出现错误"对象不正确定义提供不一致或不完整的信息"
' where m.reasoncode = er.reasoncode and m.eventprocode = ep.eventprocode'+
' and ep.name = ropertyname and er.name = :resonname'+
' and m.catchtime >=: StartDate and m.catchtime <: EndDate';
function TStatisticsQueryFrm.DoSelect(ParRow,ParLine: string): integer;
var
Query:TADOQuery;
TemStr:String;
begin
Query:=TADOQuery.Create(self);
Try
Query.Connection :=DbModule.ADOConnection1 ;
Query.SQL.Text :=CMeetReseanStr;
With query.Parameters do
begin
CreateParameter('propertyname',ftString,pdInputOutput , 20, 0);
CreateParameter('resonname',ftString,pdInputOutput , 20, 0);
CreateParameter('StartDate',ftDateTime,pdInputOutput , 0, 0);
CreateParameter('Enddate',ftDateTime,pdInputOutput , 0, 0);
end;
Query.Parameters.ParamByName('propertyname').value:=ParRow;
Query.Parameters.ParamByName('resonname').value:=ParLine;
Query.Parameters.ParamByName('StartDate').value:=StartDate;
Query.Parameters.ParamByName('Enddate').value:=Enddate;
// Query.AfterClose :=self.QueryAfterClose;
TemStr:=Query.SQL.Text; //这里设置断点,但显示参数的值并没有传过来还是原来的值
Query.Open;
Result:=Query.Fields[0].asinteger;
Except
Query.Free;
Result:=0;
end;
end;
出现错误"对象不正确定义提供不一致或不完整的信息"