问题1。在做的是查询系统,要使用者添几处文档,的用户可能会添错,所以我在窗体中加
       了个“重写” 的按钮,可我到现在还没有找到简单的方法来实现这个功能想知道大家在这个问题上是怎么做的!
问题2。我在编译我的程序是没有错误,但当运行到第5个窗体的时候,出现了这样的错误
我不知道是怎么回事
project progect1.exe raised exception class eaccessviolation with
message'access violation at addree 004038D9 in module'PROJECT1.EXE'.
read of address FFFFFFFB' process stopped.use step or run to contiune这个时候我在继续按 f9 ,并关掉这个错误提示框,程序仍然可以继续执行!我的第五个窗体的功能是核对用户密码,很简单,输入用户名,密码,然后连接数据库,进行密码的核对,成功了,打开第6个窗体,就是这个样子的,这个窗体在单独运行的时候,是没有这个提示框的,是加到主窗体后才出现的!我的这段的程序是这样的:
unit Unit3;interfaceuses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DB, DBTables, StdCtrls, Buttons;type
  TForm3 = class(TForm)
    Edit1: TEdit;
    Edit2: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    BitBtn1: TBitBtn;
    BitBtn2: TBitBtn;
    Table1: TTable;
    procedure BitBtn2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;var
  Form3: TForm3;implementationuses Unit1, Unit4, Unit2;{$R *.dfm}procedure TForm3.BitBtn2Click(Sender: TObject);
begin
   begin
     with table1 do
begin
table1.open;
 setkey ;
fieldbyname('用户名').asstring:=edit1.text;
if gotokey then
begin
if fieldbyname('密码').asstring=edit2.text
then
begin
form2.hide;
form3.hide;
form4.show;
form2.free;
form3.free;
end else
begin
messagedlg('密码不正确',mtwarning,[mbok],0);
exit;
end;
end
   else
begin
messagedlg('该用户名不存在',mtwarning,[mbok],0);
exit;
end;
end;
form1.visible:=false;
end;
end;
end.

解决方案 »

  1.   

    没太明白你的意思
    1。edit[i]:='';是不是要这个效果?
      

  2.   

    第一个问题:
    procedure TForm1.Button1Click(Sender: TObject);
    var
      i: integer;
    begin
      for i := 0 to Form1.ControlCount - 1 do
      begin
        if form1.Controls[i] is TEdit then
        TEdit(form1.Controls[i]).Text := '';
      end;
    end;
    2、不太明白你的意思
      

  3.   

    改一下你的Delphi的IDE设置应该就可以了。
    Tools--->Debuger Options--->Language Exceptions
    把Stop On Delphi Exceptions勾打掉,点OK按钮再运行程序就行了
      

  4.   

    1。edit[i]:='';不是这个样子的
    因为我的窗体中有好多的文本输入框
    我的这个按纽也就是说可以实现   返回   的功能