我是学DELPHI才几天的初学者,因为有急用,需要马上把通过别人给我的一个PAS文件生成一个EXE文件。如果我直接把这个PAS文件复制到DELPHI中保存的话,会显示Field Form1.Button1 does not have a corresponding component.Remove the declaration?
如果我直接点NO非要保存的话,保存下来也不能生成EXE 文件。
请高手指点一下,非常感谢
如果我直接点NO非要保存的话,保存下来也不能生成EXE 文件。
请高手指点一下,非常感谢
解决方案 »
- 送分问题,请教一个简单线程.
- 低调的回来了,散点分
- 一个ComboBox问题( delphi 新 手)
- 小问题:如何取得ADOQuery的查询返回结果集,如何判断结果为空?/代码如下:
- 请问大家:我想把一个文本框的内容转换成整数后除以3 再赋给一个整型变量,怎么写?这样子对吗:ppdetailband1.BandsPerRecord:=StrToIn
- 在DBGrid中如何实现当单击某一条记录时,使该条记录一行加亮或变色?
- 因为本站“搜索”很忙,无法搜索帖子,请各位帮忙。
- 简单的数据查询:如何将A表中字段A1值前几位符合B表中字段B1值的记录找到。内详
- TQuery怎么获取表的索引?
- 数据类型问题:VB调用Delphi的DLL
- 求标准偏差算法
- 出问题了!!!!
Label11: TLabel;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
那你相应的在FORM上摆上就可以
确实因为时间比较紧才出此下策,回去一定好好学习DELPHI。
PAS源程序如下:
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB, ADODB, Grids, DBGrids, StdCtrls, dxCntner, dxEditor,
dxExEdtr, dxEdLib, dxDBELib, ComCtrls, ExtCtrls;type
TForm1 = class(TForm)
ADOConnection1: TADOConnection;
ADOQuery1: TADOQuery;
GroupBox1: TGroupBox;
DateTimePicker2: TDateTimePicker;
DateTimePicker1: TDateTimePicker;
Label1: TLabel;
RadioButton2: TRadioButton;
RadioButton3: TRadioButton;
Label2: TLabel;
RadioButton1: TRadioButton;
ComboBox1: TComboBox;
ComboBox2: TComboBox;
GroupBox2: TGroupBox;
Button1: TButton;
Edit1: TEdit;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure RadioButton2Click(Sender: TObject);
procedure RadioButton3Click(Sender: TObject);
procedure RadioButton1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}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;end.
---------
你一早说你是MM,楼上的全部都抢着帮你了 :D
找給你PAS的人哦...不給就呆在他家不走^_^
ADOQuery1: TADOQuery;
GroupBox1: TGroupBox;
DateTimePicker2: TDateTimePicker;
DateTimePicker1: TDateTimePicker;另外,每个组件要进行各种属性设置,在unit中是看不出来的.
把project1全套文件(6个,编译后为8个)一起要来.