ODBC Connection in Linux

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

ODBC Connection in Linux

Postby Gablea » Oct 21, 2017 19:39

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: 2109
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: ODBC Connection in Linux

Postby MrSwiss » Oct 22, 2017 0:01

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: 850
Joined: Apr 06, 2010 0:05
Location: Northampton, United Kingdom
Contact:

Re: ODBC Connection in Linux

Postby Gablea » Oct 22, 2017 0:55

@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: 2109
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: ODBC Connection in Linux

Postby MrSwiss » Oct 22, 2017 9:30

@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: 850
Joined: Apr 06, 2010 0:05
Location: Northampton, United Kingdom
Contact:

Re: ODBC Connection in Linux

Postby Gablea » Oct 22, 2017 9:53

@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?

Return to “Linux”

Who is online

Users browsing this forum: Google [Bot] and 1 guest