MyConnection Error

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
mbranco
Posts: 3
Joined: Sat 13 Jan 2007 09:59

MyConnection Error

Post by mbranco » Sat 13 Jan 2007 10:14

Hi.

I'm newbie on MyDac (i am trying to make a decision to buy).

i have this code:

MyConnection.Open;

and in OnError event

messagedlg('error: '+e.message,mterrot,[mbOk],0);
application.terminate;

But i get the message that i want and another from windows xp that the application raise error and then show the mysql error message.

How could i prevent of showing the windows message and mysql message?

With ZeosLib i have sucess, but with MyDac i can't see how.

Thank's

MB

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Mon 15 Jan 2007 08:23

You should change to False value of the Fail parameter in the OnError event handler.

mbranco
Posts: 3
Joined: Sat 13 Jan 2007 09:59

Again: MyConnection Error

Post by mbranco » Mon 15 Jan 2007 10:27

I have made waht you have sugested. (Fail := false)

but i get the same windows message error and after another with:

Exception EAbort: in module GMoldArt.exe at 000CE811.
Operation Aborted.

I will put the all code.

in formshow event

Code: Select all

getserverconfig(MyConnection: TMyConnection); 
// will put server, user, password, and database stred in config file

try
  MyConnection.open;
except
    // never enter here why??????
    on E: Exception do
        messagedlg('Error message: '+E.Message, mterror,[mbOk],0);
end;

on ErrorEvent of myconection component

Code: Select all

messagedlg('Error: '+e.message,mtError,[mbOk],0);
Fail := False;

But i only get one error message, the one in the onerror event.

What is my Problem, if necessary i will send the project (it's in the begining)

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Re: Again: MyConnection Error

Post by Antaeus » Mon 15 Jan 2007 10:51

mbranco wrote:What is my Problem, if necessary i will send the project (it's in the begining)
Please send it to EvgeniyD*crlab*com.
Also supply us the following information:
- Exact version of Delphi or Kylix
- Exact version of MyDAC. You can see it in the About sheet of TMyConnection Editor
- Exact version of MySQL server and MySQL client. You can see it in the Info sheet of TMyConnection Editor
- Script to create and fill table if necessary

mbranco
Posts: 3
Joined: Sat 13 Jan 2007 09:59

Finally

Post by mbranco » Mon 15 Jan 2007 11:22

I have found the error

never put the connection code line ton the FormShow event

i put one button to make connection (testing) and get the error message but the windows error message never appears.

Some more tests and i will decide if we order the product.

Thank's very much for your kind

MB

Post Reply