freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
Re: [freetds] C/C++: Library usage in linux and windows
- From: "Richard Krehbiel" <richard.krehbiel AT gmail.com>
- To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
- Subject: Re: [freetds] C/C++: Library usage in linux and windows
- Date: Wed, 5 Sep 2007 08:05:37 -0400
I migrated a substantial code base (700K+ lines) from Windows to Linux, and
the database portion was a piece of cake.
The key ingredient for your C++ program is to use the ODBC API. After that
you can compile on Windows or Linux, no sweat. ODBC isolates the program
from the database drivers. So on Windows you can use either FreeTDS or MS
drivers, and on Linux (where MS drivers aren't available) you can use
FreeTDS.
Furthermore, you can change database vendors with very little impact on your
code (just SQL syntax changes). Not only did I port from Windows to Linux,
but with only a little more work (only SQL syntax tweaks) I ported from MS
SQL Server to MySQL. The driver is loaded at run time by the connection
details; you can retarget to Oracle or PostgreSQL or IBM DB2 or Ingres or
Sybase; all have Windows and Linux drivers.
On 9/5/07, Juan Perez <laslistas AT gmail.com> wrote:
>
> Hi all:
>
> I am new to FreeTDS.
> We are developing an application that have to run in Windows and Linux.
> The program is written in C/C++. The same application works in Linux
> and in Windows.
> This application has to be connections to Microsoft Sql Server.
> Simple connections: some select and some simple insert sentences.
>
> I found FreeTDS and I supose this could make the work.
>
> I am able to generate dblib.lib, FreeTDS.dll and libTDS.lib with
> MSVC (and i supose than i can generate this libraries for Linux).
> I read in the documentation that the most stable is dblib, so i
> decide to use it. But the problem is that i don´t know how.
> My first testing place is Windows. I want to create a simple
> project that conects to a database, makes a select and prints the
> result.
> So I included in the project dblib.lib library and... i dont know
> what include files y need. I try to compile the samples
> (src\odbc\unittests) without result.
> I know i am making something bad, but i don´t know what.
> Can somebody help me?
>
> Thanks in advance and excuse me for my poor english.
>
> bye...
> _______________________________________________
> FreeTDS mailing list
> FreeTDS AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds
>
-
[freetds] C/C++: Library usage in linux and windows,
Juan Perez, 09/05/2007
-
Re: [freetds] C/C++: Library usage in linux and windows,
Richard Krehbiel, 09/05/2007
-
Re: [freetds] C/C++: Library usage in linux and windows,
Juan Perez, 09/05/2007
- Re: [freetds] C/C++: Library usage in linux and windows, Richard Krehbiel, 09/05/2007
-
Re: [freetds] C/C++: Library usage in linux and windows,
Juan Perez, 09/05/2007
-
Re: [freetds] C/C++: Library usage in linux and windows,
Richard Krehbiel, 09/05/2007
Archive powered by MHonArc 2.6.24.