PostgeSQL & odbctest & SQL_NO_DATA_FOUND

From: Graydon <GraydonG(at)pbsinet(dot)com>
To: "'pgsql-odbc(at)postgresql(dot)org'" <pgsql-odbc(at)postgresql(dot)org>
Subject: PostgeSQL & odbctest & SQL_NO_DATA_FOUND
Date: 2003-05-12 18:34:18
Message-ID: E148BE531B8AD311922E005004D3EEA101B1C749@xchserv.pbsinet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

Hello,

I have spent several hours of tracking down a setup issue with PostgreSQL &
iODBC 3.0.5. While I now have it working, I am still confused as to why it
works the way it does and am hoping someone out there has the answer.

I set up odbcinst.ini and assigned it to the environmental variable
ODBCINSTINI.
I set up odbc.ini and assigned it to the environmental variable ODBCINI.

When I used odbctest to access PostgreSQL using the connect string
dsn=PostgreSQL, I kept getting:

SQLAllocEnv ( ... )
SQL_SUCCESS

SQLAllocConnect ( ... )
SQL_SUCCESS

SQLDriverConnect ( ... )
SQL_NO_DATA_FOUND

SQLError ( ... )
SQL_NO_DATA_FOUND

SQLError ( ... )
SQL_NO_DATA_FOUND

SQLFreeConnect ( ... )
SQL_SUCCESS

When I used a connect string which specified the dsn, server, port and
database it worked correctly.

In tracing the problem down, it appears that the odbctest program looks at
the odbc.ini file specified in ODBCINI only until SQLAllocConnect is
complete. From that point on, it ignores what is in ODBCINI and only
attempts to access the odbc.ini file in {$HOME}/.odbc.ini.

Therefore, copying the odbc.ini to {$HOME}/.odbc.ini allows a connect to be
made using just the dsn.

Does anyone know why it works this way? Is this a problem with PostgreSQL,
iODBC or odbctest? I would very much like to use ODBCINI to specify which
odbc.ini to use rather than have copies in everyone's {$HOME}.

Thanks in advance,

Graydon Gorby
Positive Business Solutions, Inc.

Browse pgsql-odbc by date

  From Date Subject
Next Message Greg Maples 2003-05-12 22:06:12 ODBC driver crashing both Enterprise manager and pgAdminII?
Previous Message SZŰCS Gábor 2003-05-12 17:00:40 Datasource-less connection