mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-30 04:19:22 +02:00
fcl-db: tests: Add support for "CharSet" configuration option (specified in database.ini)
git-svn-id: trunk@34093 -
This commit is contained in:
parent
bc9bcdf1f8
commit
0a72573e02
@ -196,6 +196,7 @@ begin
|
|||||||
UserName := dbuser;
|
UserName := dbuser;
|
||||||
Password := dbpassword;
|
Password := dbpassword;
|
||||||
HostName := dbhostname;
|
HostName := dbhostname;
|
||||||
|
CharSet := dbcharset;
|
||||||
if dblogfilename<>'' then
|
if dblogfilename<>'' then
|
||||||
begin
|
begin
|
||||||
LogEvents:=[detCustom,detCommit,detExecute,detRollBack];
|
LogEvents:=[detCustom,detCommit,detExecute,detRollBack];
|
||||||
|
@ -224,6 +224,7 @@ var dbtype,
|
|||||||
dbuser,
|
dbuser,
|
||||||
dbhostname,
|
dbhostname,
|
||||||
dbpassword,
|
dbpassword,
|
||||||
|
dbcharset,
|
||||||
dblogfilename,
|
dblogfilename,
|
||||||
dbQuoteChars : string;
|
dbQuoteChars : string;
|
||||||
dblogfile : TextFile;
|
dblogfile : TextFile;
|
||||||
@ -476,17 +477,18 @@ procedure ReadIniFile;
|
|||||||
var IniFile : TIniFile;
|
var IniFile : TIniFile;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
IniFile := TIniFile.Create(getcurrentdir + PathDelim + 'database.ini');
|
IniFile := TIniFile.Create(GetCurrentDir + PathDelim + 'database.ini');
|
||||||
dbtype:='';
|
dbtype:='';
|
||||||
if Paramcount>0 then
|
if ParamCount>0 then
|
||||||
dbtype := ParamStr(1);
|
dbtype := ParamStr(1);
|
||||||
if (dbtype='') or not inifile.SectionExists(dbtype) then
|
if (dbtype='') or not IniFile.SectionExists(dbtype) then
|
||||||
dbtype := IniFile.ReadString('Database','Type','');
|
dbtype := IniFile.ReadString('Database','Type','');
|
||||||
dbconnectorname := IniFile.ReadString(dbtype,'Connector','');
|
dbconnectorname := IniFile.ReadString(dbtype,'Connector','');
|
||||||
dbname := IniFile.ReadString(dbtype,'Name','');
|
dbname := IniFile.ReadString(dbtype,'Name','');
|
||||||
dbuser := IniFile.ReadString(dbtype,'User','');
|
dbuser := IniFile.ReadString(dbtype,'User','');
|
||||||
dbhostname := IniFile.ReadString(dbtype,'Hostname','');
|
dbhostname := IniFile.ReadString(dbtype,'Hostname','');
|
||||||
dbpassword := IniFile.ReadString(dbtype,'Password','');
|
dbpassword := IniFile.ReadString(dbtype,'Password','');
|
||||||
|
dbcharset := IniFile.ReadString(dbtype,'CharSet','');
|
||||||
dbconnectorparams := IniFile.ReadString(dbtype,'ConnectorParams','');
|
dbconnectorparams := IniFile.ReadString(dbtype,'ConnectorParams','');
|
||||||
dblogfilename := IniFile.ReadString(dbtype,'LogFile','');
|
dblogfilename := IniFile.ReadString(dbtype,'LogFile','');
|
||||||
dbquotechars := IniFile.ReadString(dbtype,'QuoteChars','"');
|
dbquotechars := IniFile.ReadString(dbtype,'QuoteChars','"');
|
||||||
|
Loading…
Reference in New Issue
Block a user