Problem: Dynamic SQLConnection using dbexpress + MySQL
Hi NG,
I am working on an application in which I try to access a MySQL Database
using dynamically created TSQLConnections. I want to assign the parameters
at runtime, so using and deploying the dbxconnection.ini is not an option.
However not using dbxconnection.ini my program won't connect the
SQLConnections to the database.
I keep getting "Unknown Username/Password" from dbexpress.
Login-name, servername and password are correct, If I use the dbxconnection
the program can establish a connection.
Maybe I just forgot to set a property.
Any help / working code-sample is greatly appreciated.
Thank you for your time!
Chris
---------------------schnipp------------------------
// Erzeuge dynamisch eine SQLConnection
with TSQLConnection.Create(Hauptfenster) do
begin
Name := 'SQLConnection' + dbId;
ConnectionName := 'MySQLConnection';
DriverName := 'MySQL';
GetDriverFunc := 'getSQLDriverMYSQL';
LibraryName := 'dbexpmysql.dll';
LoadParamsOnConnect := false;
LoginPrompt := false;
params.Values['DriverName'] := 'MySQL';
params.Values['HostName'] := 'xxxxxxx';
params.Values['Database'] := 'yyyy';
params.Values['User_Name'] := 'zzzzz';
params.Values['Password='] := 'vvvv';
params.Values['BlobSize'] := '-1';
params.Values['LocaleCode'] := '0000';
VendorLib := 'libmysql.dll';
Connected := true;
end;
---------------------schnapp------------------------