Zlatko Matić wrote:
Could someone send me some screenshots,code or examples showing how
to implement ODBC connection with PostgreSQL in Lazarus, on Windows?
Thanks in advance,
To know which properties the TODBCConnection component supports, look at the
comments in the source (they are next to the property definitions in the class
declaration).
Basically, you can use the Params property to set any parameter necessary. I
don't know about the PostGreSQL ODBC driver which parameters it supports.
Some TODBCConnection properties are mapped to ODBC Connection Parameters; from
the source mentioned above:
property Driver:string read FDriver write FDriver; // will be passed as
DRIVER connection parameter
property FileDSN:string read FFileDSN write FFileDSN; // will be passed as
FILEDSN parameter
property Password; // will be passed as PWD connection parameter
property UserName; // will be passed as UID connection parameter
property HostName; // ignored
property DatabaseName; // will be passed as DSN connection parameter
property LoginPrompt; // if true, ODBC drivers might prompt for more
details that are not in the connection string
property Params; // will be added to connection string
Note in particular that
- the driver is identitfied by the 'Driver' property.
- the DatabaseName property maps to a DSN, an ODBC DataSourceName, not to a
database of the DBMS.
- if you use a file with ODBC settings, there is the FileDSN property
- the HostName property is ignored
The reason for all this is that there is no uniform naming scheme of the
parameters. Probably the easiest way to connect is to create a .dsn file using
the ODBC Driver Manager (which provides a GUI) and use the FileDSN property.
Regards,
Bram
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives