how to open a database local or remote with IniFile. something like the below.
vBanco : String;
IniFileName : TIniFile;
begin
IniFileName := TIniFile.Create(ExtractFilePath(ParamStr(0))+FileName);
Try
if FileExists (remote+'db\ado.mdb') then
begin
vBanco := Trim(IniFileName.ReadString('acesso','BancoRemto',''));
Dirlocal := Trim(IniFileName.ReadString('acesso','PastasRemto',''));
frmPrincipal.Edit1.text := Dirlocal;
Dirtrabalho := (ExtractFilePath(Application.ExeName));
Conection.ConnectionString := vBanco;
end
else
begin
Try
vBanco := Trim(IniFileName.ReadString('acesso','banco',''));
Dirlocal := Trim(IniFileName.ReadString('acesso','PastasLocais',''));
frmPrincipal.Edit1.text := Dirlocal;
Dirtrabalho := (ExtractFilePath(Application.ExeName));
Finally
end;
end;
Finally
IniFileName.Free;
end;
end;