Just beginning, so will post loads..
1st, if MySql isn't running, this code errors:-
procedure TfrmLogon.Button1Click(Sender: TObject);
var uname,pword :string;
ErrorCode :Integer;
begin
uname :=edit1.Text;
pword := password.text;
if not frmDBcontrols.SQLConnection1.Connected then
begin
showMessage('Database Not connected');
try
frmDBcontrols.SQLConnection1.Connected:=true;
//if ErrorCode <> 0 then // only 0 should be correct
// raise Exception.Create('Error: code = ' + IntToStr(ErrorCode))
except
on E: Exception do
showMessage('error');
end;
end;
end;
is there an elegant way to trap the error if MySql isn't running? (I know that errorcode isn't used in this example)
Ta - Andy
1st, if MySql isn't running, this code errors:-
procedure TfrmLogon.Button1Click(Sender: TObject);
var uname,pword :string;
ErrorCode :Integer;
begin
uname :=edit1.Text;
pword := password.text;
if not frmDBcontrols.SQLConnection1.Connected then
begin
showMessage('Database Not connected');
try
frmDBcontrols.SQLConnection1.Connected:=true;
//if ErrorCode <> 0 then // only 0 should be correct
// raise Exception.Create('Error: code = ' + IntToStr(ErrorCode))
except
on E: Exception do
showMessage('error');
end;
end;
end;
is there an elegant way to trap the error if MySql isn't running? (I know that errorcode isn't used in this example)
Ta - Andy