On 09-Sep-2004 Christian Stalp wrote:
> 
>> You don't call unixODBC.  You setup a data source for unixODBC, then you
>> reference the datasource as if it was a dataserver. I just went through
>> this exercise. The odbc.ini and odbcinst.ini need to have the correct
>> entries for the source of your data. The name that is created in brackets
>> is the name you pass to DBI.
> 
> Thank you very much, but there are some technical questions...
> 
> The entry of my odbc.ini is:
> [ODBC Data Sources]
> refdb
> 
> [refdb]
> ServerDB=refdb
> ServerNode=

This looks like an iODBC driver manager ini file, you are using the unixODBC
driver manager aren't you?

unixODBC mirrors ODBC in Windows. You need an odbcinst.ini file which defines
your ODBC drivers and an odbc.ini file which defines your data sources.

e.g.
odbcinst.ini
============

[ODBC]
TraceFile               = /tmp/sql.log
Trace           = no

[OOB]
Description             = Easysoft ODBC-ODBC Bridge
Driver          = /usr/local/easysoft/oob/client/libesoobclient.so
Setup           = /usr/local/easysoft/oob/client/libesoobsetup.so
FileUsage               = 5

[PostgreSQL]
Description     = Postgres SQL Driver
Driver          = /usr/local/easysoft/unixODBC/lib/libodbcpsql.so.2.0.0
FileUsage       = 1
CPTimeout       = 120

which defines two drivers, OOB and postgres.

odbc.ini
========

[mssqlserver]
Description = MS SQL Server
Driver = OOB
Server = xxx.yyy.zzz
Port = 8888
TargeDSN = test
LogonUser = xxxx
LogonAuth = yyyy

[postgres]
Description         = Test to Postgres
Driver              = PostgreSQL
Trace               = No
TraceFile           = /tmp/sql.log
Database            = test
Servername          = xxx.yyy.zzz
UserName            = XXXX
Password            = XXXX
Port                = 5432
Protocol            = 6.4
ReadOnly            = No
RowVersioning       = No
ShowSystemTables    = No
ShowOidColumn       = No
FakeOidIndex        = No
ConnSettings        =

which defines two data sources, one using the OOB ODBC driver and the other
using the Postgres ODBC driver.

> Where I have to fill in:   dbi:UnixODBC:refdb

This should be dbi:ODBC:refdb.

> I don't have any odbcinst.ini, nor I heard of it. I have virtually no 
> documentaion here and SoftwareAG is not responding to my questions. :-( 

See the http://www.unixodbc.org where there are examples of odbc.ini and
odbcinst.inio files.

> Can you give me an example how to connect to the database via the UnixODBC? 
> $dbh = DBI->connect ( .... ????? )

May be if I knew what ODBC driver you are using
 
Martin
--
Martin J. Evans
Easysoft Ltd, UK
Development

Reply via email to