Delphi7 使用 dbxopenmysql50 连接 MySQL 数据库
以下代码展示了如何在 Delphi7 中使用 dbxopenmysql50.dll
连接到 MySQL 数据库:
var
SQLConnection1: TSQLConnection;
begin
SQLConnection1 := TSQLConnection.Create(nil);
SQLConnection1.DriverName := 'dbxmysql';
SQLConnection1.GetDriverFunc := 'getSQLDriverMYSQL50';
SQLConnection1.LibraryName := 'dbxopenmysql50.dll';
SQLConnection1.VendorLib := 'libmysql.dll';
SQLConnection1.LoginPrompt := false;
SQLConnection1.Params.Append('Database=TdTestDb');
SQLConnection1.Params.Append('User_Name=xzx');
SQLConnection1.Params.Append('Password=xzx');
SQLConnection1.Params.Append('HostName=192.168.0.188');
SQLConnection1.Open;
// ... 后续数据库操作 ...
end;
911.85KB
文件大小:
评论区