TmyConnection Problem

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
kenny
Posts: 43
Joined: Mon 15 Nov 2004 08:48
Location: Malaysia
Contact:

TmyConnection Problem

Post by kenny » Thu 20 Jan 2005 02:01

Hi,
I'm using Delphi 5, MyDac 3.30.2.15.

I attempt to assign myconnection.connect to true at runtime, it appear the lost connection error.

Screen.Cursor := crHourGlass;
Try
MyConnection1.Connected := False;
MyConnection1.Server := TPCIP.FieldByName('IPAddress').AsString;
MyConnection1.Connected := True;
MessageDlg('Succesfully connected to IP : '
+ TPCIP.FieldByName('IPAddress').AsString
, mtInformation, [mbOK], 0);

Except
MessageDlg('Failed to connect to IP : '
+ TPCIP.FieldByName('IPAddress').AsString
, mtError, [mbOK], 0);
End;
Screen.Cursor := crDefault;

but when I used following code then work ok

Screen.Cursor := crHourGlass;
Try
MyConnection1.Connected := False;
MyConnection1.Server := TPCIP.FieldByName('IPAddress').AsString;

//MyConnection1.Connected := True;
QCheckConnect.Close;
QCheckConnect.Open;
MessageDlg('Succesfully connected to IP : '
+ TPCIP.FieldByName('IPAddress').AsString
, mtInformation, [mbOK], 0);

Except
MessageDlg('Failed to connect to IP : '
+ TPCIP.FieldByName('IPAddress').AsString
, mtError, [mbOK], 0);
End;
Screen.Cursor := crDefault;

This happend when the network is 100mbs but the client station is longer than that. (ps: design time the myconnection assign to true is work)

Thanks

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Re: TmyConnection Problem

Post by Ikar » Thu 20 Jan 2005 15:11

Does the behaviour change if to add a row

QCheckConnect.Server := MyConnection1.Server;

at the second case?

What value is set to ConnectionTimeout?

kenny
Posts: 43
Joined: Mon 15 Nov 2004 08:48
Location: Malaysia
Contact:

Post by kenny » Fri 21 Jan 2005 01:44

Hi,

QCheckConnect is TMyQuery component, and I found out that no Server properties to assign on it : QCheckConnect.Server := MyConnection1.Server; (Undeclare identifier 'Server')

The timeout connection I'd tried before were 15,30,60,90 and also 180 but not working at runtime too.

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Fri 21 Jan 2005 07:47

We couldn't reproduce the problem.
Please send us (mydac*crlab*com) complete small sample to demonstrate it.

kenny
Posts: 43
Joined: Mon 15 Nov 2004 08:48
Location: Malaysia
Contact:

Post by kenny » Sat 22 Jan 2005 03:42

Hi,
This is the code for testing.
The network connection is 100mps while the distance of PC1 & PC2 is more than 100mps.
Screen.Cursor := crHourGlass;
Try
MyConnection1.Connected := False;
MyConnection1.Server := TPCIP.FieldByName('IPAddress').AsString;
MyConnection1.Connected := True;
MessageDlg('Succesfully connected to IP : '
+ TPCIP.FieldByName('IPAddress').AsString
, mtInformation, [mbOK], 0);

Except
MessageDlg('Failed to connect to IP : '
+ TPCIP.FieldByName('IPAddress').AsString
, mtError, [mbOK], 0);
End;
Screen.Cursor := crDefault;
Thanks

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Mon 24 Jan 2005 10:52

Unfortunately by partial example we couldn't reproduce the problem. Please send complete sample.

Post Reply