简单例子:
delphi:
procedure TWMover.WMoverWebActionItem1Action(Sender: TObject;
Request: TWebRequest;
Response: TWebResponse;
var Handled: Boolean);
var Stemp:string;
Itemp:integer;
begin
shortdateformat:='yyyy-mm-dd';
dateseparator:='-';
//查询
DBhr.Params.Values['USER NAME']:=Request.QueryFields.Values['userNo'];
DBhr.Params.Values['PASSWORD']:=Request.QueryFields.Values['password'];
if Request.QueryFields.Values['dptNo']<>'' then
begin
Qwhere0.Close;
Qwhere0.ParamByName('pstr').asstring:=Request.QueryFields.Values['dptNo'];
Qwhere0.Open;
Itemp:=Qwhere0.FieldValues['whr']-1;
Stemp:=copy(Request.QueryFields.Values['dptNo'],1,Itemp)+'%';
end
else
Stemp:='%';
Qemployes.Close;
Qemployes.ParamByName('pdptNo').asstring:=Stemp;
Qemployes.Open;
QSum.Close;
QSum.ParamByName('pdptNo').asstring:=Stemp;
QSum.Open;
DTPempCount.Footer.Add('<table border="1" width="100%"> '+
'<tr><TD><center>总计</TD><TD><center>'+
QSum.fieldbyname('SNum').asstring+'</TD></tr></body></html>');
Response.Content:=DTPempCount.Content;
end;
HTML:
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html;
charset=gb_2312-80">
</HEAD>
<BODY LINK="#0000ff" VLINK="#800080" BACKGROUND="ImageSelect.jpg">
<img src="Goldeast.gif" width="40"height="40"><font size="4"
face="楷体_GB2312"><strong><u><i>金东纸业(江苏)有限公司</u></i></strong></font><p>
<FORM ACTION="http://w3/app/wms/CGIempCount.exe" METHOD="GET">
<FONT FACE="楷体_GB2312" LANG="ZH-CN" SIZE=5><P ALIGN="CENTER">人事管理系统之部门人数查询</P>
</FONT>
<FONT FACE="楷体_GB2312" LANG="ZH-CN"><P>操作员代号(?):
<INPUT TYPE="TEXT" MAXLENGTH="15" NAME="userNo" size=20>
操作员密码(?):
<INPUT TYPE="PASSWORD" MAXLENGTH="15" NAME="password" size=20>
</FONT>
<hr>
<FONT FACE="宋体" LANG="ZH-CN"><P>请输入要查询的部门的条件: </FONT>
<P>
部门编号(四位数):
<INPUT TYPE="TEXT" MAXLENGTH="4" NAME="dptNo" size=6>
</FONT>
<FONT FACE="System,黑体" LANG="ZH-CN"><P><HR></P>
</FONT><FONT FACE="宋体" LANG="ZH-CN"><P>
<INPUT TYPE="SUBMIT" VALUE="查询" >
<INPUT TYPE="RESET" VALUE="复位">
</P></FORM></FONT></BODY>
</HTML>