Hi folks,
It seems to be very simple but, I am quite baffeled.
I am trying to connect to data dictionary on certain ip address. I have
"TAdsConnection" components on form without any properties. I set them via
delphi program.
To make sure the connection is made or not, I check "IsConnected" property.
My understanding is if connection is not made "IsConnected" property will
become False so my program should response accordingly.
However, any case whether connection string is right or worng is get
connection is made response. Following is code in on button click.
//----------------------------------------------------------------
procedure TForm1.ConnectClick(Sender: TObject);
var srvadd:string;
i:integer;
save_cursor:tcursor;
begin
srvadd:=quotedstr(ebDBAddress.Text); <------------------- Text box on
form
if srvadd='' then begin
showmessage('Please provide server path');
exit;
end;
save_cursor:=crDefault;
screen.Cursor:=crHourGlass;

// cn is ADS Component on form;

try

with cn do begin


ConnectPath:=srvadd;

LoginPrompt:=False;
Name:='Test';
Password:=ebPassword.Text; <---------------- Text box on form
UserName:=ebUser.Text; <----------------- Text box on form

IsConnected:=True;


if IsConnected=True then begin
memResponse.Lines.Add('Connected');
end
else begin
memResponse.Lines.Add('Not Connected');
end;

end;
finally
screen.Cursor:=save_cursor;
end;

end;

procedure TForm1.FormShow(Sender: TObject);
begin
memResponse.Lines.Clear;
end;

end.
//---------------------------------------------------------

In other words I am trying to check it database server is there or not on
LAN.

Appreciate some light on the issue.

maaz
mrizki@fairwaymarket.com