-
October 31st, 2015, 04:42 PM
#1
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 ?
-
November 1st, 2015, 05:38 AM
#2
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.
All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!
C++23 Compiler: Microsoft VS2022 (17.6.5)
-
November 1st, 2015, 08:56 AM
#3
Re: c++ wrapper for sql server?
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
-
November 1st, 2015, 11:12 AM
#4
Re: c++ wrapper for sql server?
If you're using Visual Studio, why not use the CRecordset class?
-
November 1st, 2015, 12:07 PM
#5
Re: c++ wrapper for sql server?
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 ?
-
November 1st, 2015, 12:43 PM
#6
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.
All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!
C++23 Compiler: Microsoft VS2022 (17.6.5)
-
November 1st, 2015, 06:05 PM
#7
Re: c++ wrapper for sql server?
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.
-
November 2nd, 2015, 07:31 PM
#8
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.
-
November 3rd, 2015, 03:25 AM
#9
Re: c++ wrapper for sql server?
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
-
November 5th, 2015, 02:53 AM
#10
Re: c++ wrapper for sql server?
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.
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.
Best regards,
Igor
-
November 5th, 2015, 08:26 PM
#11
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.
Last edited by Arjay; November 5th, 2015 at 08:40 PM.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|