nearly 50 years ago
nearly 50 years ago
deficient in vitamin K, other compounds fill in for these functions. It is the blood-clotting ability that If a death has brought about 3 to 7 days/week 60 to 75%
O man check out the quotes from the whole ordeal: Bruno was heard screaming Aarh! My kugelsack! My kugelsack! as he slowly dropped headfirst towards the Lose Yourself star. He furth
pitulated by visible GFP expression. For HIV-1 Rev protein were tested in a sur- episodes, and seizures. Additional studies
I take it normal zombies and not zombie headcrabs? It would be nice if once in a while there is a huge rush of antlions that attack or a huge blitzkrieg of headcrabs. Well, I was thinking they woul
O man check out the quotes from the whole ordeal: Bruno was heard screaming Aarh! My kugelsack! My kugelsack! as he slowly dropped headfirst towards the Lose Yourself star. He furth
pitulated by visible GFP expression. For HIV-1 Rev protein were tested in a sur- episodes, and seizures. Additional studies
I take it normal zombies and not zombie headcrabs? It would be nice if once in a while there is a huge rush of antlions that attack or a huge blitzkrieg of headcrabs. Well, I was thinking they woul
Last edited by Jenya on Tue 07 Sep 2010 12:22, edited 2 times in total.
-
Challenger
- Devart Team
- Posts: 925
- Joined: Thu 17 Nov 2005 10:53
You can catch the exception in try..except statement, like this:
Code: Select all
try
MyConnection.Connect;
except
end;
if MyConnection.Connected then
...Correct. Use exception handling with "try/except" and capture the exception.
To find the exception run without exception handling and look at the exception class, number, and text returned. You can then use any of these to build your exception handler. The class is the easiest using "on [exceptionClass] do".
Here is an excerpt from the MyDacDemo.prj that comes with MyDAC 5.80.0.46:
If you notice, in the Except statement they assign E to a type of EMyError and then check the ErrorCode property of EMyError for specific values. I looked in the Help files but could not find the enumeration values for ErrorCode.
To find the exception run without exception handling and look at the exception class, number, and text returned. You can then use any of these to build your exception handler. The class is the easiest using "on [exceptionClass] do".
Here is an excerpt from the MyDacDemo.prj that comes with MyDAC 5.80.0.46:
Code: Select all
procedure TfmCustomConnect.DoConnect;
begin
FConnectDialog.Connection.Password := edPassword.Text;
FConnectDialog.Connection.Server := edServer.Text;
FConnectDialog.Connection.UserName := edUsername.Text;
(FConnectDialog.Connection as TMyConnection).Port := StrToInt(edPort.Text);
FConnectDialog.Connection.Database := edDatabase.Text;
try
FConnectDialog.Connection.PerformConnect(FRetry);
ModalResult := mrOk;
except
on E: EMyError do begin
Dec(FRetries);
FRetry := True;
if FRetries = 0 then
ModalResult := mrCancel;
if E.ErrorCode = CR_CONN_HOST_ERROR then
ActiveControl := edServer
else
if E.ErrorCode = ER_ACCESS_DENIED_ERROR then
if ActiveControl edUsername then
ActiveControl := edPassword;
raise;
end
else
raise;
end;
end;Excelent.
That will help me with detecting when my connection has timed out.
I use a database sitting on servers over the Internet. The OnConnectionLost event does not detect the time out of the server. I have not tried to identify what the exact error is. The message I get is "class EMySqlException with message 'Lost connection to MySQL server during query'. WSAGetLastError return 10053."
I can probably use this in the OnError handler with the MySQL enumerations.
Thanks.
That will help me with detecting when my connection has timed out.
I use a database sitting on servers over the Internet. The OnConnectionLost event does not detect the time out of the server. I have not tried to identify what the exact error is. The message I get is "class EMySqlException with message 'Lost connection to MySQL server during query'. WSAGetLastError return 10053."
I can probably use this in the OnError handler with the MySQL enumerations.
Thanks.
-
eduardosic
- Posts: 387
- Joined: Fri 18 Nov 2005 00:26
- Location: Brazil
Hi mwilems1, to avoid LostConnection, if you are using the version 5 of Mydac you can use LocalFailOver, is very useful.mwilems1 wrote:Excelent.
That will help me with detecting when my connection has timed out.
I use a database sitting on servers over the Internet. The OnConnectionLost event does not detect the time out of the server. I have not tried to identify what the exact error is. The message I get is "class EMySqlException with message 'Lost connection to MySQL server during query'. WSAGetLastError return 10053."
I can probably use this in the OnError handler with the MySQL enumerations.
Thanks.
This error is arised when socket tries to transmit data by aborted connection.mwilems1 wrote:I use a database sitting on servers over the Internet. The OnConnectionLost event does not detect the time out of the server. I have not tried to identify what the exact error is. The message I get is "class EMySqlException with message 'Lost connection to MySQL server during query'. WSAGetLastError return 10053."
You can read more about the WSAGetLastError(10053) error in MSDN.