Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 Feb 2001 20:47:56 +0600 (NS)
From:      Max Khon <fjoe@iclub.nsu.ru>
To:        Mike Meyer <mwm@mired.org>
Cc:        freebsd-database@FreeBSD.ORG
Subject:   Re: unixODBC help?
Message-ID:  <Pine.BSF.4.21.0102012041290.35759-100000@iclub.nsu.ru>
In-Reply-To: <14969.13345.991875.173020@guru.mired.org>

next in thread | previous in thread | raw e-mail | index | archive | help
hi, there!

On Thu, 1 Feb 2001, Mike Meyer wrote:

> > > > > Has anyone out there managed to get the unixODBC port to work?
> > > > > Especially talking to the postgres7 port with ODBC enabled? If so, any
> > > > > pointers would be appreciated; the docs seem to refer to tools I don't
> > > > > have.
> > > > works like a charm here.
> > > > you do not have to enable ODBC in postgresql7 port because unixODBC has
> > > > its own PostgreSQL ODBC driver. There is ongoing work to merge unixODBC
> > > > driver with one PostgreSQL has in its tree.
> > > Knowing that you've got it working isn't a lot of help. Can you
> > > provide details, or pointers to documentation?
> > knowing that it does not work for you does not help much either :)
> > can you tell what is not working?
> 
> Everything.
> 
> I know, not much help. Let's see....
> 
> Well, the user manual talks about OODBConfig and DataManager, but they
> port didn't install them :-(.
> 
> Given the clue that I should be looking in the unixODBC port for
> drivers, I actually got past the previous problem (errors from
> odbcinst). That now seems to work, with template files lifted from the
> docs, except to change the database name to one I actually have):
> 
> su-2.04# odbcinst -i -d -f /tmp/foobar 
> [odbcinst] Driver installed. Usage count increased to 3. Target directory is /usr/lib
> su-2.04# odbcinst -i -s -f /tmp/foobaz
> [odbcinst] Sections and Entries from /tmp/foobar have been added to ODBC.INI
> 
> Though the "Target directory is /usr/lib" worries me somewhat.
> 
> The isql documentation doesn't actually say what string from the
> various template files should be used for the DSN. Trying the obvious
> one generates an error:
> 
> guru$ isql PostgreSQL
> [ISQL]ERROR: Could not SQLConnect
> 
> I don't see any sign of an sql.log file around.
> 
> The eventual goal is to connect with the Applixware Office data
> application. Being able to verify that some part of it is working
> would be a nice start.

odbcinst is a bit tricky (was tricky at the time I looked at it)
basically, you should have two files in /usr/local/etc:
--- cut here (odbcinst.ini) ---
[PostgreSQL]
Description     = PostgreSQL driver
Driver          = /usr/local/lib/libodbcpsql.so
Setup           = /usr/local/lib/libodbcpsqlS.so
FileUsage       = 1
;Debug          = 1
--- cut here ---

odbcinst.ini describes which drivers are installed on your system

--- cut here (odbc.ini) ---
[test]
Description     = PostgreSQL
Driver          = PostgreSQL
Database        = test
Servername      = localhost
Readonly        = No
--- cut here ---

odbc.ini file describe DSNs ("test" in the example above is DSN).
You can have multiple DSNs pointing to one database.

I hope this will be sufficient for you to start

/fjoe



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-database" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0102012041290.35759-100000>