The following is the code below:
procedure TfrmSelection.FormActivate(Sender: TObject);
var
ArqIni: TIniFile;
begin
ArqIni := ArqIni.Create('C:\sga\saga.ini');
try
ZConnection1.Connected := false;
ZConnection1.HostName := ArqIni.ReadString('BASEDADOS', 'PathSec', '');
ZConnection1.Database := ArqIni.ReadString('BASEDADOS','Base', '');
ZConnection1.Password := ArqIni.ReadString('BASEDADOS','Chave', '');
except
on E:Exception do MessageDlg('Erro ao conectar!'#13'Erro: '+ e.Message, mtError, [mbOK], 0);
end;
end;
However, I believe this is the code that is giving Access Violation error.
My question is: How would I do to improve the code to the point of re-creating the folder, the file and the contents of it in case of deletion of the .INI file?