Page 1 of 2

BCB + AfterConnect + AV

Posted: Sun 11 Jun 2006 14:33
by bedla.czech
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

Posted: Tue 13 Jun 2006 14:00
by Antaeus
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.

Posted: Wed 14 Jun 2006 08:56
by bedla.czech
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 :-)

Posted: Wed 14 Jun 2006 11:01
by Antaeus
We have sent the modified program to you by e-mail.

Posted: Thu 15 Jun 2006 18:31
by bedla.czech
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.

Posted: Fri 16 Jun 2006 12:50
by Antaeus
> 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?

Posted: Mon 19 Jun 2006 12:57
by bedla.czech
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.

Posted: Mon 19 Jun 2006 13:17
by Antaeus
We have sent you the program to specified e-mail address.

Posted: Mon 19 Jun 2006 16:52
by bedla.czech
:-) email has arrived, thanks

Posted: Tue 20 Jun 2006 13:58
by bedla.czech
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

Posted: Tue 20 Jun 2006 15:03
by Antaeus
Does the problem appear in the program we have as well?

Posted: Wed 21 Jun 2006 09:26
by bedla.czech
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

Posted: Thu 22 Jun 2006 10:06
by Antaeus
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.

Posted: Mon 10 Jul 2006 10:32
by bedla.czech
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

Posted: Tue 11 Jul 2006 15:07
by Antaeus
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.