FireDAC WTF of the day 😉
Conn := TFDConnection.Create(nil);
Conn.DriverName := FireDriverLink.BaseDriverId;
// The above lines were actually in a function in the worker pool
for tgt in targetlist
do begin
Conn.Params.Clear;
Conn.Params.Values[‘Server’] := tgt.Host;
Conn.Params.Values[‘Database’] := tgt.DatabaseName;
Conn.Params.Values[‘OSAuthent’] := ‘No’;
Conn.Params.Values[‘User_Name’] := tgt.UserName;
Conn.Params.Values[‘Password’] := tgt.Password;
Conn.Connect;
Exception: Driver name not set.
I added the above clear since I would be reusing the connection for multiple databases in a loop, and it took me a few rounds in the debugger before I figured out that the property mapped into the params list instead of a property field of it’s own.
Lesson learned.
You must be logged in to post a comment.