Home > Back-end >  Delphi 7 to connect the mysql prompt internalconnection: DLL/Shared library nam
Delphi 7 to connect the mysql prompt internalconnection: DLL/Shared library nam

Time:11-03

I use the two DLL without drive connections, libmysql. DLL and dbxopenmysql50. DLL
With simpledataset1. Connection do

The begin

Try
The Close;
GetDriverFunc:='getSQLDriverMYSQL50';
LibraryName:='dbxopenmysql50. DLL';
VendorLib:='LIBMYSQL. DLL';
DriverName:='dbxmysql';
Params. Values [' drivername] :='MySQL';
Params. Values [' port '] :='3306';
Params. Values [' hostname] :='127.0.0.1';
Params. Values [' database '] :='root';
Params. Values [' user_name] :='root';
Params. Values [' password '] :='123';
Form1. SimpleDataSet1. Active:=false;
Form1.SimpleDataSet1.DataSet.Com mandText:='select * from the user where the username=: username';
Form1. SimpleDataSet1. DataSet. ParamByName (" username "). The Asstring:=username;
Form1. SimpleDataSet1. Active:=true;
Form1. SimpleDataSet1. Edit;
Password:=form1. SimpleDataSet1. FieldByName (" password "). The Asstring;

Except on E: the Exception do
Raise the Exception. The Create (' database connection error: '+ E.M essage);

end;

end;

Error into the topic

CodePudding user response:

Connect mySql has two DLL, in addition to you, and there's a libMysql51. DLL

CodePudding user response:

Libmysql. DLL version right
  • Related