BCB + AfterConnect + AV

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
bedla.czech
Posts: 23
Joined: Wed 10 Aug 2005 09:10

BCB + AfterConnect + AV

Post by bedla.czech » Sun 11 Jun 2006 14:33

hi,

i found some strange problem. please see example project and try to compile and run it.
the problem is that if a have trying to connect in OnCreate event of
DataModule and than after connect trying to send some SQL statements to server it will reproduce AV error (at ->Execute(1) line).
the error is occuring only if you have this lines

Code: Select all

 MyConnection1->Port = 3306;
 MyConnection1->Server = "192.168.1.100";
 MyConnection1->Username = "root";
 MyConnection1->Password = "";
 MyConnection1->Database = "kettler_systemdb";
version 4.0.x.x was OK, new versions are bad :-(
where is this problem? on my, yours or borlands site?

thanks bedla

Code: Select all

http://tnpw.6v-webdesign.com/crlab01.zip

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

Post by Antaeus » Tue 13 Jun 2006 14:00

We couldn't compile your project without some changes. We have removed from the project link to ExceptionLog.pas and corrected paths to %MyDAC%\include and %MyDAC%\lib. After that project was successfully compiled and ran. No errors were raised.
Possibly the problem appears on your side because of third-party components you use. We can send you for test by e-mail the modified project.

bedla.czech
Posts: 23
Joined: Wed 10 Aug 2005 09:10

Post by bedla.czech » Wed 14 Jun 2006 08:56

Antaeus wrote:We couldn't compile your project without some changes. We have removed from the project link to ExceptionLog.pas and corrected paths to %MyDAC%\include and %MyDAC%\lib. After that project was successfully compiled and ran. No errors were raised.
Possibly the problem appears on your side because of third-party components you use. We can send you for test by e-mail the modified project.
ok send it, my email is in my profile :-)

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

Post by Antaeus » Wed 14 Jun 2006 11:01

We have sent the modified program to you by e-mail.

bedla.czech
Posts: 23
Joined: Wed 10 Aug 2005 09:10

Post by bedla.czech » Thu 15 Jun 2006 18:31

Antaeus wrote:We have sent the modified program to you by e-mail.
email doesnt arrive at this time.
but i have tried to remove exceptionlog link from project and error still occuring and i dont have lib and include subdirs. i have bought source code version of your lib.

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

Post by Antaeus » Fri 16 Jun 2006 12:50

> email doesnt arrive at this time.
We have sent you two letters on June, 13. Did you receive any of them?

> i have bought source code version of your lib.
Does this problem occur using source code of MyDAC? Are you able to ascertain what causes the problem?

bedla.czech
Posts: 23
Joined: Wed 10 Aug 2005 09:10

Post by bedla.czech » Mon 19 Jun 2006 12:57

Antaeus wrote:> email doesnt arrive at this time.
We have sent you two letters on June, 13. Did you receive any of them?
no, i havent receive any. please try to send on my second email (bedla.czech AT gmail.com)
Antaeus wrote:> i have bought source code version of your lib.
Does this problem occur using source code of MyDAC? Are you able to ascertain what causes the problem?
yes it does. every time when i have free time i have trying to find where is this bud. but with no solution. maybe when your email will arrive it will solve by your solution.

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

Post by Antaeus » Mon 19 Jun 2006 13:17

We have sent you the program to specified e-mail address.

bedla.czech
Posts: 23
Joined: Wed 10 Aug 2005 09:10

Post by bedla.czech » Mon 19 Jun 2006 16:52

:-) email has arrived, thanks

bedla.czech
Posts: 23
Joined: Wed 10 Aug 2005 09:10

Post by bedla.czech » Tue 20 Jun 2006 13:58

after a hour testing i have finally found the bug, if it is bug :-)

1) when setting MyConnection1->Server property the OnAfterConnect event is fired
2) i thing that it is wrong, OnAfterConnect event should be fired after calling Connect() method
3) i have a look to source code and i thing that it is somewhere around procedure TCustomDAConnection.SetConnected(Value: boolean); function :-)
4) uff :-))

try to solve it or please give me a hint how to solve it on my side :-)

THANKS

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

Post by Antaeus » Tue 20 Jun 2006 15:03

Does the problem appear in the program we have as well?

bedla.czech
Posts: 23
Joined: Wed 10 Aug 2005 09:10

Post by bedla.czech » Wed 21 Jun 2006 09:26

Antaeus wrote:Does the problem appear in the program we have as well?
yes it does.

hint:
put breakpoints on line
1) MyConnection1->Server = "192.168.1.100";
2) void __fastcall TDataModule2::MyConnection1AfterConnect(TObject *Sender)
and you will see

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

Post by Antaeus » Thu 22 Jun 2006 10:06

Possibly the problem concerns your installation of C++Builder because we can't reproduce the problem using the same test application you use. Try compiling this sample on another computer or try reinstalling your C++Builder.

bedla.czech
Posts: 23
Joined: Wed 10 Aug 2005 09:10

Post by bedla.czech » Mon 10 Jul 2006 10:32

i dont know how but spoken error still occurs :-( i have latest version of MyDAC VCL. i have made project with some logging, so try it please now.

in zip is project source, codeguard log, screenshot and log from compiled version by my self.

there is

Code: Select all

#define MYLOG 1
in source code.
when is set to 1: program is doing things as describet before
when is set to 2: trying surround with try/catch, program connects to but fires onConnect events only before Connect() method, after dont :-(
details are in mylog.txt file. and there is resource leak when destroying project (see CodeGuard log and screenshot)

so please take a look

thanks

attatchment:

Code: Select all

http://tnpw.6v-webdesign.com/corelab.zip

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

Post by Antaeus » Tue 11 Jul 2006 15:07

Thak you for sample. We have reproduced the problem. The investigation of the problem is in progress. Unfortunately now we cannot give you any information. As soon as we solve the problem we'll let you know.

Post Reply