新
新手上路请超车
Unregistered / Unconfirmed
GUEST, unregistred user!
unit WebMd;
interface
uses
SysUtils, Classes, HTTPApp, HTTPProd,StrUtils, DB, ADODB;
type
TWebDM = class(TWebModule)
PageProducer1: TPageProducer;
webconn: TADOConnection;
aqDJ: TADOQuery;
PPDefault: TPageProducer;
procedure WebDMWebActionItem1Action(Sender: TObject;
Request: TWebRequest;
Response: TWebResponse;
var Handled: Boolean);
private
{ Private declarations }
djh,fwmb:integer;
public
{ Public declarations }
end;
var
WebDM: TWebDM;
implementation
{$R *.DFM}
procedure TWebDM.WebDMWebActionItem1Action(Sender: TObject;
Request: TWebRequest;
Response: TWebResponse;
var Handled: Boolean);
var s:Tstringlist;
begin
PageProducer1.HTMLFile:='';
fwmb:=strtoint(ReQuest.QueryFields[0]);
djh:=strtoint(ReQuest.QueryFields[1]);
s:=Tstringlist.Create;
try
ADOConnection1.Connected:=True;
except
s.Add('COnn error<br>');
end;
try
ADOQuery1.Close;
except
s.Add('ADO Error1(close error)<br>');
end;
try
ADOQuery1.Parameters.ParamValues['djbh']:=djh;
except
s.Add('ADO Error2<br>');
end;
try
ADOQuery1.Parameters.ParamValues['fwmbid']:=fwmb;
except
s.Add('ADO Error3<br>');
end;
try
ADOQuery1.Open;
except
s.Add('ADO Error4(open error)<br>');
end;
Response.Content:=PageProducer1.Content;
Handled:=True;
end;
end.
webdm.ADOConnection1和webdm.ADOQuery1的设置都没有问题
运行后得到的页面竟然是
COnn error
ADO Error1(close error)
ADO Error2
ADO Error3
ADO Error4(open error)
真是莫名,应当如何解决?
interface
uses
SysUtils, Classes, HTTPApp, HTTPProd,StrUtils, DB, ADODB;
type
TWebDM = class(TWebModule)
PageProducer1: TPageProducer;
webconn: TADOConnection;
aqDJ: TADOQuery;
PPDefault: TPageProducer;
procedure WebDMWebActionItem1Action(Sender: TObject;
Request: TWebRequest;
Response: TWebResponse;
var Handled: Boolean);
private
{ Private declarations }
djh,fwmb:integer;
public
{ Public declarations }
end;
var
WebDM: TWebDM;
implementation
{$R *.DFM}
procedure TWebDM.WebDMWebActionItem1Action(Sender: TObject;
Request: TWebRequest;
Response: TWebResponse;
var Handled: Boolean);
var s:Tstringlist;
begin
PageProducer1.HTMLFile:='';
fwmb:=strtoint(ReQuest.QueryFields[0]);
djh:=strtoint(ReQuest.QueryFields[1]);
s:=Tstringlist.Create;
try
ADOConnection1.Connected:=True;
except
s.Add('COnn error<br>');
end;
try
ADOQuery1.Close;
except
s.Add('ADO Error1(close error)<br>');
end;
try
ADOQuery1.Parameters.ParamValues['djbh']:=djh;
except
s.Add('ADO Error2<br>');
end;
try
ADOQuery1.Parameters.ParamValues['fwmbid']:=fwmb;
except
s.Add('ADO Error3<br>');
end;
try
ADOQuery1.Open;
except
s.Add('ADO Error4(open error)<br>');
end;
Response.Content:=PageProducer1.Content;
Handled:=True;
end;
end.
webdm.ADOConnection1和webdm.ADOQuery1的设置都没有问题
运行后得到的页面竟然是
COnn error
ADO Error1(close error)
ADO Error2
ADO Error3
ADO Error4(open error)
真是莫名,应当如何解决?