ODBC Connection in Linux

Linux specific questions.
Post Reply
Gablea
Posts: 1104
Joined: Apr 06, 2010 0:05
Location: Northampton, United Kingdom
Contact:

ODBC Connection in Linux

Post by Gablea »

Hi everyone,

I know you can use ODBC in FreeBASIC within a windows version of FreeBASIC I was just wondering if you can use ODBC inside a Linux version of a program?

I have been reading online that you can get ODBC drivers for Linux now and I was just interested in seeing what people think or have any one actually managed to get a ODBC connection to work and if so what was the code you was using.

as this web site http://www.unixodbc.org/ is showing you can use ODBC applications and connect to MySQL , MS Server etc

Andy
MrSwiss
Posts: 3910
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: ODBC Connection in Linux

Post by MrSwiss »

A quick look shows that: the ODBC drivers are shared libraries (.so) so, the
use in FB, would be similar, to the use of .dll on Win (.so on 'ix: UNIX/LINUX).
No code from me on that one, I'm doing Win only ...
Gablea
Posts: 1104
Joined: Apr 06, 2010 0:05
Location: Northampton, United Kingdom
Contact:

Re: ODBC Connection in Linux

Post by Gablea »

@MrSwiss

Is using ODBC easier then direct connection to the database? (Like with mysql and FreeBASIC)

I did once do one of the examples On here for using ODBC in Windows and it work great. So would it be better to design a program that uses the ODBC interface to talk to the database server or to use a direct interface to it?
MrSwiss
Posts: 3910
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: ODBC Connection in Linux

Post by MrSwiss »

@Andy,

I'd use ODBC because, it "abstracts" from the used RDBMS (any SQL-Server).
If you ever have to use a different DB, there will be no changes to the APPL. itself,
only on the ODBC connector setup ...
Gablea
Posts: 1104
Joined: Apr 06, 2010 0:05
Location: Northampton, United Kingdom
Contact:

Re: ODBC Connection in Linux

Post by Gablea »

@MrSwiss

That sounds like a good idea and if I had a setup ini file I could just change the DNS name in there (I did use ODBC with my old VB6 Version of my software)

Is there any examples on the FreeBASIC website for using
ODBC?
Post Reply