delphi问题
unit Unit1;interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB, ADODB, StdCtrls;
type
TForm1 = class(TForm)
ADOConnection1: TADOConnection;
ADOQuery1: TADOQuery;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Edit1: TEdit;
Edit2: TEdit;
Button1: TButton;
Button2: TButton;
procedure Button2Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
uses unit2;
{$R *.dfm}
procedure TForm1.Button2Click(Sender: TObject);
begin
Application.Terminate;//退出系统
end;
procedure TForm1.Button1Click(Sender: TObject);
var username ,password:string;
begin
if edit1.Text=''then
messagebox(Form1.Handle,'请输入用户名','警告',mb_ok+mb_iconwarning)
else
if edit1.Text=''then
messagebox(Form1.Handle,'请输入密码','警告',mb_ok+mb_iconwarning)
else
begin
username:=edit1.Text ;
password:=edit2.Text;
with ADOQuery1 do
begin
close;
sql.Clear;
sql.add('select*from 用户管理 where username=');
open;
first;
if recordcount=1 then
begin
Form1.Hide;
Form2.Show;
end
else
messagebox(Form1.Handle,'请输入用户名','警告',mb_ok+mb_iconwarning) ;
end;
end;
end;
[错误] Unit1.pas(96): Declaration expected but end of file found
[致命错误] Project1.dpr(5): Could not compile used unit 'Unit1.pas'
谢谢了,在线等
补充:修改了一下,只剩一个错误了[错误] Project1.dpr(6): ',' or ';' expected but identifier 'Unit2' found