Re: Postgresql ODBC driver not found
On Thu, Sep 23, 2021 at 08:44:42AM +0200, Pierre Couderc wrote:
> Thank you very much!
>
> See below :
>
> On 9/22/21 3:37 PM, Henning Follmann wrote:
> > On Wed, Sep 22, 2021 at 11:07:28AM +0200, Pierre Couderc wrote:
> > > It is here I see it/them with:
> > >
> > > odbcinst -q -d
> > >
> > > but not with :
> > >
> > > SQLHENV env;
> > > SQLCHAR driver[256];
> > > SQLCHAR attr[256];
> > > SQLSMALLINT driver_ret;
> > > SQLSMALLINT attr_ret;
> > > SQLUSMALLINT direction;
> > > SQLRETURN ret;
> > > SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &env);
> > > SQLSetEnvAttr(env, SQL_ATTR_ODBC_VERSION, (void *) SQL_OV_ODBC3, 0);
> > >
> > > direction = SQL_FETCH_FIRST;
> > > while(SQL_SUCCEEDED(ret = SQLDrivers(env, direction,
> > > driver, sizeof(driver), &driver_ret,
> > > attr, sizeof(attr), &attr_ret))) {
> > > direction = SQL_FETCH_NEXT;
> > > printf("%s - %s\n", driver, attr);
> > > if (ret == SQL_SUCCESS_WITH_INFO) printf("\tdata truncation\n");
> > > }
> > >
> > > What do I miss...?
> > >
> > The ability to clearly describe your problem!
> Sorry I tried to be minimum... But here are more details?
Not sorry, but what do you expect? That everybody has a magic crystal bowl to
fill in missing information?
> >
> > What did you do?
> > I assume you wrote some c code.
> Yes, this code above is written in c (c++ in fact but I have simplified).
That is not c code. This does not compile.
Provide a minimum example which compiles, at least.
> > Did you compile it? And if so, how?
> Yes, with default tools (gcc under debian bulllseye linked with libodbc)
Are you kidding me? That is not additional information. Just you
being condescending.
Strike one.
> > You installed odbcunix I assume.
> > How did you configure it?
> Correctly.
Really? REALLY?
Strike two.
> > What is the output of "odbcinst -q -d"?
>
> Correct :
>
> [PostgreSQL ANSI]
> [PostgreSQL Unicode]
>
all right that is something.
can you please connect to your database with:
isql "PostgreSQL Unicode" <user> <password>
and perform a minimum check like:
select 1;
> > What did you expect?
> That my c program produces the same list
> >
> > What did not work?
> > Include logs, error messages.
>
> Logs and error messages : none (This is the heart of the problem)
>
> >
> > What did you do to solve your problem so far?
> >
> I have reduced my problem - which is much more complex - to the simplest
> test prograam.
>
> And I ask for help, as I have no more idea after many hours.
>
>
You know this is a debian user mailing list, right?
but anyway...
-H
--
Henning Follmann | hfollmann@itcfollmann.com
Reply to: