No ODBC Drivers available?

Linux specific forum
merendo
Enthusiast
Enthusiast
Posts: 449
Joined: Sat Apr 26, 2003 7:24 pm
Location: Germany
Contact:

No ODBC Drivers available?

Post by merendo »

Cheers.

I am trying to code a little app which queries a MySQL server thru the database commands. But when I call ExamineDatabaseDrivers(), it just returns NULL and no drivers are listed.

I use Mandrake 9.2 and installed all RPMs found for the keyword ODBC. And InitDatabase doesn't return any errors, so I am almost certain that odbc works on my system.

What could be the problem?

Thx in advance, merendo
The truth is never confined to a single number - especially scientific truth!
olejr
Enthusiast
Enthusiast
Posts: 152
Joined: Sun Jul 11, 2004 7:48 pm
Location: Lillehammer, No(r)way
Contact:

Re: No ODBC Drivers available?

Post by olejr »

merendo wrote: And InitDatabase doesn't return any errors
What's the return value then? If it's 0 then ODBC is
not available or too old..
[EDIT]
I'm running Mandrake 10, and on my machine pbcompiler
throws an: /usr/bin/ld: cannot find -lodbc :(
merendo
Enthusiast
Enthusiast
Posts: 449
Joined: Sat Apr 26, 2003 7:24 pm
Location: Germany
Contact:

Post by merendo »

I am not certain what it does return but I am certain that it doesn't return 0.

I also got that error but then I took RpmDrake and installed any packages I found for the keyword 'odbc' and then it worked.
The truth is never confined to a single number - especially scientific truth!
olejr
Enthusiast
Enthusiast
Posts: 152
Joined: Sun Jul 11, 2004 7:48 pm
Location: Lillehammer, No(r)way
Contact:

Post by olejr »

My error messages are gone! And it works..
Did the same thing you did installed everything 'odbc'..

Don't know but maybe you need the odbc connector from
mysql.com.. If you're using mysql that is...
Because all drivers listed on my system is from that package..
merendo
Enthusiast
Enthusiast
Posts: 449
Joined: Sat Apr 26, 2003 7:24 pm
Location: Germany
Contact:

Post by merendo »

Hmm.... And where exactly do I get that connector? Searched mysql.com but didn't find something...
The truth is never confined to a single number - especially scientific truth!
olejr
Enthusiast
Enthusiast
Posts: 152
Joined: Sun Jul 11, 2004 7:48 pm
Location: Lillehammer, No(r)way
Contact:

Post by olejr »

merendo
Enthusiast
Enthusiast
Posts: 449
Joined: Sat Apr 26, 2003 7:24 pm
Location: Germany
Contact:

Post by merendo »

Hmm... downloaded and installed the MyODBC-3.51.09-1.i586.rpm but PB still doesn't find any odbc drivers...

There still something gotta be wrong.
The truth is never confined to a single number - especially scientific truth!
olejr
Enthusiast
Enthusiast
Posts: 152
Joined: Sun Jul 11, 2004 7:48 pm
Location: Lillehammer, No(r)way
Contact:

Post by olejr »

the ODBC from mysql does not configure itself!
You have to do that 'by hand'!!

Code: Select all

Edit /usr/share/doc/packages/MyODBC/odbc.ini (the *.so files are in /usr/lib)
Copy odbc.ini to /etc

Add this to /etc/profile:
  ODBCINI="/etc/odbc.ini"
  ODBCSYSINI="/etc/odbc.ini"
  export ODBCINI ODBCSYSINI
Here's the FAQ:
http://dev.mysql.com/doc/connector/odbc/en/faq_toc.html
This did it for me anyway...
Post Reply