c++ wrapper for sql server?
hello guys
i need a c++ sql server wrapper that can connect to sql server using odbc.
i find this one but i cant able to use it in visual studio 2015 community
so if anyone of you know the best c++ odbc wrapper please suggest me.
1 nanodbc [i try to use this but visual studio give me so many error coz it use c++ 11 standard i guess , alos it didnt work in code block (gcc compiler)]
2 TinyODBC C++ this one also not working
if someone plz try to compile the nanodbc in visual studio and tell me that you able to do that or not ?
Re: c++ wrapper for sql server?
nanodbc.cpp/nanodbc.h compiles OK for me with MS VS 2015 Community with just a couple of warnings.
Re: c++ wrapper for sql server?
Quote:
Originally Posted by
2kaud
nanodbc.cpp/nanodbc.h compiles OK for me with MS VS 2015 Community with just a couple of warnings.
do you have sql server or mysql use the odbc and try to connect the database using nanodbc and tell me if it works in visual studio 2015
Re: c++ wrapper for sql server?
If you're using Visual Studio, why not use the CRecordset class?
Re: c++ wrapper for sql server?
Quote:
Originally Posted by
GCDEF
If you're using Visual Studio, why not use the CRecordset class?
can you give me the link of the tutorial how to use the CRecordset class ?
Re: c++ wrapper for sql server?
https://msdn.microsoft.com/en-us/library/92bcy0kw.aspx
there are also examples documented with some of the class functions eg https://msdn.microsoft.com/en-us/library/1hkkwdf0.aspx
If you search MSDN there are other examples of its use.
Re: c++ wrapper for sql server?
Quote:
Originally Posted by
tjnapster555
can you give me the link of the tutorial how to use the CRecordset class ?
I'm pretty sure Google can point you in the right direction.
Re: c++ wrapper for sql server?
Another option for Visual Studio C++ is to use the ATL Database consumer classes. They are not well known, but are lighter weight and easier to use than the MFC database classes, imo.
Re: c++ wrapper for sql server?
Quote:
Originally Posted by
Arjay
Another option for Visual Studio C++ is to use the ATL Database consumer classes. They are not well known, but are lighter weight and easier to use than the MFC database classes, imo.
can you give me the link of tutorial other than Microsoft website which i never understand
Re: c++ wrapper for sql server?
Quote:
Originally Posted by
Arjay
Another option for Visual Studio C++ is to use the ATL Database consumer classes. They are not well known, but are lighter weight and easier to use than the MFC database classes, imo.
I always was fine with plain ADO. Never even thought about third party classes. :) However, in one of commercial projects I had to use something really lightweight and license-safe, so I ended up with a minimalistic ODBC wrapper made all myself. It din't take me much time to craft one, and supporting it for years never caused any trouble as it was nothing more than just ODBC API with C++ as little as possible.
Quote:
Originally Posted by
tjnapster555
can you give me the link of tutorial other than Microsoft website which i never understand
Sorry, all the links that I have are from MSDN.
Re: c++ wrapper for sql server?
It's too bad that no one uses the ATL consumer db classes - imo, they are much easier to use than the MFC classes. Also, if the db schema changes, there only one file to update.
I don't have anything more recent but the following link is how the use the ATL Consumer db classes to connect to an Access db.
http://forums.codeguru.com/showthrea...ables-database
Connecting to sql is a simple matter of point the wizard to a sql data source instead of access.
This link has example source code and you should be able to import the sln into a more recent version of Visual Studio. Probably some some of the wizard steps descibed in the text have changed as well. Still, it should be enough to get you going.