帮我看一下,这代码哪里错了?
procedure TForm4.FormShow(Sender: TObject);
var str:string;
begin
str:='DBQ='+'database\database.mdb'+';Driver={Driver do Microsoft Access (*.mdb)};DriverId=25;FIL=MS Access;UID=admin;UserCommitSync=Yes;';
adoconnection1.Close;
try
adoconnection1.ConnectionString :=str;
//ADOQuery1.Close;
ADOQuery1.Connection :=adoconnection1;
except
messagedlg('数据连接失败!',mterror,[mbok],0);
end;
end;
procedure TForm4.SpeedButton1Click(Sender: TObject);
begin
adoQuery1.SQL.Clear;
adoQuery1.SQL.Text := 'Insert Into user ([密码]) Values (' + '''' + edit1.Text + '''' + ')' ;
//adoQuery1.SQL.Add('Insert Into user ([密码])');
//adoQuery1.SQL.Add('Values ("abc")');
//adoQuery1.SQL.Add('Values (' + '''' + edit1.Text + ''''+ ')');
//ADOQuery1.SQL.Text := ' Where 用户名='+label1.Caption;
adoQuery1.ExecSQL;
end;