fcl-db: tests: Add support for "CharSet" configuration option (specified in database.ini)

git-svn-id: trunk@34093 -
This commit is contained in:
lacak 2016-07-11 07:40:38 +00:00
parent bc9bcdf1f8
commit 0a72573e02
2 changed files with 6 additions and 3 deletions

View File

@ -196,6 +196,7 @@ begin
UserName := dbuser;
Password := dbpassword;
HostName := dbhostname;
CharSet := dbcharset;
if dblogfilename<>'' then
begin
LogEvents:=[detCustom,detCommit,detExecute,detRollBack];

View File

@ -224,6 +224,7 @@ var dbtype,
dbuser,
dbhostname,
dbpassword,
dbcharset,
dblogfilename,
dbQuoteChars : string;
dblogfile : TextFile;
@ -476,17 +477,18 @@ procedure ReadIniFile;
var IniFile : TIniFile;
begin
IniFile := TIniFile.Create(getcurrentdir + PathDelim + 'database.ini');
IniFile := TIniFile.Create(GetCurrentDir + PathDelim + 'database.ini');
dbtype:='';
if Paramcount>0 then
if ParamCount>0 then
dbtype := ParamStr(1);
if (dbtype='') or not inifile.SectionExists(dbtype) then
if (dbtype='') or not IniFile.SectionExists(dbtype) then
dbtype := IniFile.ReadString('Database','Type','');
dbconnectorname := IniFile.ReadString(dbtype,'Connector','');
dbname := IniFile.ReadString(dbtype,'Name','');
dbuser := IniFile.ReadString(dbtype,'User','');
dbhostname := IniFile.ReadString(dbtype,'Hostname','');
dbpassword := IniFile.ReadString(dbtype,'Password','');
dbcharset := IniFile.ReadString(dbtype,'CharSet','');
dbconnectorparams := IniFile.ReadString(dbtype,'ConnectorParams','');
dblogfilename := IniFile.ReadString(dbtype,'LogFile','');
dbquotechars := IniFile.ReadString(dbtype,'QuoteChars','"');