Page 1 of 1

MyConnection Error

Posted: Sat 13 Jan 2007 10:14
by mbranco
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

Posted: Mon 15 Jan 2007 08:23
by Antaeus
You should change to False value of the Fail parameter in the OnError event handler.

Again: MyConnection Error

Posted: Mon 15 Jan 2007 10:27
by mbranco
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)

Re: Again: MyConnection Error

Posted: Mon 15 Jan 2007 10:51
by Antaeus
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

Finally

Posted: Mon 15 Jan 2007 11:22
by mbranco
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