procedure TForm1.Button1Click(Sender: TObject);
begin
try
ADOCon1.ConnectionString:=(‘DRIVER={MySQL ODBC 3.51 Driver};’+
‘SERVER=localhost;’+
‘DATABASE=lionx;’+
‘USER=root;’+
‘PASSWORD=109;’+
‘OPTION=3;’);
ADOCon1.Close;
ADOCon1.Open;
except
application.MessageBox(‘无法连接数据库服务器.请与管理员联系’,'提示’,MB_ICONINFORMATION);
end ;
ADOQ1.Active:=true;
end;

 

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>