[fpc-devel] TSQLConnection.CharSet improvement suggestion
graemeg.lists at gmail.com
Tue May 26 15:09:32 CEST 2009
TSQLConnection.CharSet is defined as follows:
property CharSet : string read FCharSet write FCharSet;
Currently you can pass parameters via the Params property, but they
don't seem to be taken into account at all!! At least this is true for
Interbase/Firebird connections. This is clearly not good.
A simple solution would be to use getter methods as follows:
property CharSet : string read GetCharSet write FCharSet;
The GetCharSet method would then return FCharSet, but if it is empty,
it must check the Params property for values. In the case of
Interbase/Firebird that would be 'charset' or 'lc_ctype' in the Params
value list. GetCharSet can be made virtual, so that other database
backends (firebird, mysql, etc) can override it and to the extra tests
and return possible values from Params property.
If this is ok, I will go ahead and make the change for CharSet
property. Other properties will also benefit from this like:
Username, Password, Role, DatabaseFilename, etc...
- Graeme -
fpGUI - a cross-platform Free Pascal GUI toolkit
More information about the fpc-devel