Board index » delphi » Problem: Dynamic SQLConnection using dbexpress + MySQL

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------------------------

 

Re:Problem: Dynamic SQLConnection using dbexpress + MySQL


Quote
"Christopher St?rkel" <minos...@onlinehome.de> wrote in message

news:arb5m4$938$00$1@news.t-online.com...

Quote
>       params.Values['Password='] := 'vvvv';

This line looks awfully suspect.
--
Dan Miser
http://www.distribucon.com

Re:Problem: Dynamic SQLConnection using dbexpress + MySQL


What dan said and this looks like the old dll.

Quote
Christopher St?rkel wrote:
> Hi NG,

>       VendorLib := 'libmysql.dll';

> ---------------------schnapp------------------------

--
Thomas Miller
Delphi Client/Server Certified Developer
BSS Accounting & Distribution Software
BSS Enterprise Accounting FrameWork

http://www.bss-software.com

Re:Problem: Dynamic SQLConnection using dbexpress + MySQL


works now, stupid typo of mine.
It is the latest libmysql.dll from mysqltools.com.

Thanks for taking the time to help me

Chris

Quote
----- Original Message -----
From: "Thomas Miller" <tmil...@bss-software.com>

Newsgroups: borland.public.delphi.database.dbexpress
Sent: Monday, November 18, 2002 8:19 PM
Subject: Re: Problem: Dynamic SQLConnection using dbexpress + MySQL

> What dan said and this looks like the old dll.

> Christopher St?rkel wrote:
> > Hi NG,

> >       VendorLib := 'libmysql.dll';

> > ---------------------schnapp------------------------

> --
> Thomas Miller
> Delphi Client/Server Certified Developer
> BSS Accounting & Distribution Software
> BSS Enterprise Accounting FrameWork

> http://www.bss-software.com

Re:Problem: Dynamic SQLConnection using dbexpress + MySQL


Thank you.
Didn't spot the typo. Thanks for your taking the time to help me.
You saved my life. (Project is due tomorrow)

Have a great day

Chris

Quote
>>      params.Values['Password='] := 'vvvv';

> This line looks awfully suspect.

Yes, get rid of the '=' char in the "Password" param name.

Re:Problem: Dynamic SQLConnection using dbexpress + MySQL


Quote
Dan Miser wrote:
> "Christopher St?rkel" <minos...@onlinehome.de> wrote in message
> news:arb5m4$938$00$1@news.t-online.com...

>>      params.Values['Password='] := 'vvvv';

> This line looks awfully suspect.

Yes, get rid of the '=' char in the "Password" param name.

Other Threads