if Radio_ChooseIp.checked then //如果ComboBox_chooseip控件可用
begin
if pagecount=endpage then //判断是否为最后一页,如果是则显示提示信息'已经是最后一页了!'
begin
ShowMessage('已经是最后一页了!');
exit;
end
else //如果不是则页数加1
inc(Pagecount,1);
Edit_pagenumshow.Text:=inttostr(pagecount); //文本框中显示页数
getvalue:=trim(ipedit_inputip.IPString); //接收输入的ip地址
begin
with Query1 do begin
showMessage('hehe');
Close;
SQL.Clear;
SQL.Add('select top '+inttostr(per_page_count)+' t.id,t.ip,t.mac,t.webip,t.actime,t.url,t.title,t.useragent from '+table+' t');
sql.add('where t.id not in(select top '+inttostr((Pagecount-1)*per_page_count)+' t.id from '+table+' t ');
sql.add('where t.ip='''+getvalue+''' and t.actime>=:firstdatetime and t.actime<=:seconddatetime )');
sql.add('and t.ip='''+getvalue+''' and t.actime>=:firstdatetime and t.actime<=:seconddatetime ');
query1.Parameters.ParamByName('firstdatetime').Value :=strtodatetime(formatdatetime('yyyy-MM-dd', dtpDate1.Date) +' '+formatdatetime('HH:mm:ss', dtpTime1.Time));
query1.Parameters.ParamByName('seconddatetime').Value :=strtodatetime(formatdatetime('yyyy-MM-dd', dtpDate2.Date) +' '+formatdatetime('HH:mm:ss', dtpTime2.Time));
open;
dbgrid1.DataSource:=datasource1;
showMessage('h0h0');
end;
end;
end;