Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Connecting to Microsoft SQL Server from C++

Author  Topic 

juanetes
Starting Member

8 Posts

Posted - 2011-01-25 : 16:07:44
I am looking for a simple (and free) way to make queries to a Microsoft SQL Server from C++. I can use either Linux or Windows. I have my project compiled on Microsoft Visual C++ Express (Windows) and Codelite (Linux).
What do you suggest? From what I have seen so far most of libraries to do this doesn't support MS SQL Server. The idea is to just make a simple queries on my code and hence I would like to do it in the easiest way possible (even if this is not with the best library).

Thanks in advance

robvolk
Most Valuable Yak

15732 Posts

Posted - 2011-01-25 : 16:53:31
Take a look here: http://www.freetds.org/

MS Visual C++ should work fine with ActiveX Data Objects (ADO), there's a tutorial here: http://www.w3schools.com/ado/default.asp

You might have to hunt around for C++ examples, or if you know VB/VBScript you can translate existing examples.
Go to Top of Page

juanetes
Starting Member

8 Posts

Posted - 2011-01-26 : 12:38:09
Thanks. I checked it out but it doesn't seems very easy for a linux beginner like me.
Does anyone knows some other library? Maybe for Windows?
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2011-01-26 : 12:50:30
ADO and ADO.Net are the preferred data access libraries on Windows, with raw OLE DB and ODBC a distant second & third. They're written by Microsoft and will perform better than other (free) drivers.
Go to Top of Page

juanetes
Starting Member

8 Posts

Posted - 2011-01-26 : 15:40:01
Thanks. I would look for some wrapper of ADO in C++
Go to Top of Page
   

- Advertisement -