open database with initfile

Posted by ml on Stack Overflow See other posts from Stack Overflow or by ml
Published on 2010-06-07T22:10:37Z Indexed on 2010/06/07 22:12 UTC
Read the original article Hit count: 144

Filed under:
|

how to open a database local or remote with IniFile. something like the below.

[code]vBanco : String; IniFileName : TIniFile; begin if FileExists (remote+'db\ado.mdb')

IniFileName := TIniFile.Create(ExtractFilePath(ParamStr(0))+FileName); Try vBanco := Trim(IniFileName.ReadString('acesso','BancoRemto','')); Dirlocal := Trim(IniFileName.ReadString('acesso','PastasRemto','')); frmPrincipal.Edit1.text := Dirlocal; Dirtrabalho := (ExtractFilePath(Application.ExeName));

Conection.ConnectionString := vBanco;

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; end;

IniFileName.Free;

© Stack Overflow or respective owner

Related posts about delphi

Related posts about initfileurlwithpath