我是学DELPHI才几天的初学者,因为有急用,需要马上把通过别人给我的一个PAS文件生成一个EXE文件。如果我直接把这个PAS文件复制到DELPHI中保存的话,会显示Field Form1.Button1 does not have a corresponding component.Remove the declaration?
如果我直接点NO非要保存的话,保存下来也不能生成EXE 文件。
请高手指点一下,非常感谢
...全文
33413打赏收藏
别人我一个pas源文件,怎么才能得到DPR文件并生成EXE文件????
我是学DELPHI才几天的初学者,因为有急用,需要马上把通过别人给我的一个PAS文件生成一个EXE文件。如果我直接把这个PAS文件复制到DELPHI中保存的话,会显示Field Form1.Button1 does not have a corresponding component.Remove the declaration? 如果我直接点NO非要保存的话,保存下来也不能生成EXE 文件。 请高手指点一下,非常感谢
procedure TForm1.Button1Click(Sender: TObject);
var
cs,datestr1,datestr2:string;
begin
cs:='select count(*) as tmpjs from 馆藏典藏库 as a where';
datestr1:=datetostr(datetimepicker1.date);
datestr2:=datetostr(datetimepicker2.date);
if datetimepicker2.date<datetimepicker1.date then
begin
edit1.Text:='日期选择有误!';
exit;
end;
if datetimepicker2.date=datetimepicker1.date then
cs:=cs+' a.处理时间>=convert(smalldatetime,'''+datestr1+' 00:00:00'')'+' and a.处理时间<convert(smalldatetime,'''+datestr1+' 23:59:59'')';
if datetimepicker2.date>datetimepicker1.date then
cs:=cs+' a.处理时间>=convert(smalldatetime,'''+datestr1+' 00:00:00'')'+' and a.处理时间<convert(smalldatetime,'''+datestr2+' 23:59:59'')';
//edit1.Text:=cs;
//exit;
if radiobutton1.Checked then
begin
adoquery1.SQL.Clear;
adoquery1.SQL.Add(cs);
adoquery1.Open;
edit1.Text:=adoquery1.fieldbyname('tmpjs').AsString;
end;
if radiobutton2.Checked then
begin
cs:=cs+' and (a.操作员='+copy(combobox1.Text,1,4)+')';
adoquery1.SQL.Clear;
adoquery1.SQL.Add(cs);
adoquery1.Open;
edit1.Text:=adoquery1.fieldbyname('tmpjs').AsString;
end;
if radiobutton3.Checked then
begin
cs:=cs+' and (';
adoquery1.SQL.Clear;
adoquery1.SQL.Add('select * from 系统用户信息 where 工作部门='''+trim(combobox2.Text)+'''');
adoquery1.Open;
while not adoquery1.Eof do
begin
cs:=cs+' a.操作员='+adoquery1.fieldbyname('用户代码').AsString;
adoquery1.Next;
if not adoquery1.Eof then cs:=cs+' or ';
end;
cs:=cs+')';
adoquery1.Close;
adoquery1.SQL.Clear;
adoquery1.SQL.Add(cs);
adoquery1.Open;
edit1.Text:=adoquery1.fieldbyname('tmpjs').AsString;
//edit1.Text:=cs;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
var
cs:string;
begin
datetimepicker1.DateTime:=now();
datetimepicker2.DateTime:=now();
cs:='Provider=SQLOLEDB.1;Password=goldlibgdlis;Persist Security Info=True;User ID=sa;Initial Catalog=GdlisXP;Data Source=211.83.192.214;';
cs:=cs+'Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=WXP2000S;Use Encryption for Data=False;Tag with column collation when possible=False';
adoconnection1.ConnectionString:=cs;
adoconnection1.Connected:=true;
adoquery1.SQL.Clear;
adoquery1.SQL.Add('select * from 系统用户信息 order by 用户代码');
adoquery1.Open;
while not adoquery1.Eof do
begin
combobox1.Items.Add(adoquery1.Fieldbyname('用户代码').AsString+stringofchar(' ',4-length(adoquery1.Fieldbyname('用户代码').AsString))+adoquery1.Fieldbyname('姓名').AsString);
adoquery1.Next;
end;
adoquery1.SQL.Clear;
adoquery1.SQL.Add('select 工作部门 from 系统用户信息 group by 工作部门');
adoquery1.Open;
while not adoquery1.Eof do
begin
combobox2.Items.Add(adoquery1.Fieldbyname('工作部门').AsString);
adoquery1.Next;
end;
combobox1.ItemIndex:=0;
combobox2.ItemIndex:=0;
adoquery1.Close;
end;
procedure TForm1.RadioButton2Click(Sender: TObject);
begin
combobox1.Enabled:=true;
combobox2.Enabled:=false;
end;
procedure TForm1.RadioButton3Click(Sender: TObject);
begin
combobox2.Enabled:=true;
combobox1.Enabled:=false;
end;
procedure TForm1.RadioButton1Click(Sender: TObject);
begin
combobox1.Enabled:=false;
combobox2.Enabled:=false;
end;