Today i will share a tips for delphi programmer for beginner. This time i’d like to share about how to check Connection from ADOConnection is it the server establish or not.
First you have to use ComObj Unit, because we need EOleException Function to check availability server connection. Well here’s an example :
unit Unit1;
interface
uses
ComObj, Windows, Messages, SysUtils, Variants, Classes,
Graphics, Controls, Forms, Dialogs;type
TForm1 = class(TForm)……
After append unit ComObj in uses list, you can use EOleException in your code like this
with ADOConnection1 do
Try
Connected := True;
except
on EOleException do
begin
MessageDlg(‘Connection Broken, Please try to connect again !’,MtInformation,[mbOK],0);
end;
end;
I hope this tips can make us getting better to learn Delphi


Assalamu’alaykum
eh Bab, sorry ya…
apa ga terlalu boring nih tampilannya ?
Wassalam