C++ Database Connection
I need to connect to a database with c++, I have tried to use mySql++, mySql connector, and a few others however I am unable to get them running, I've tried the tutorials but I can't seem to get them right. VS doesn't see the files that I try to include.
Anyways, Is there a somewhat easy way to connect to a database using c++ without needing to download a ton of files or api's. and if so could you please provide a link to a tutorial, ive tried using ODBC, however I don't think ive been doing it right as it shows a ton of errors in my code.
any help would be appreci开发者_开发百科ated, Thanks
How about OTL. It is just a header file so far away from tons of files. And all you need is the libraries depending on the DB you want to connect to.
ODBC is a little bare metal - surely there are some more accessable ADO classes (you might need MDAC)?
First, you have to know what kind of database you have to connect to. It does matter, as you won't use the same API to connect to a MySQL database, or to a SQLite one, or Oracle, or Postgres, or SQL Server ...
Then, have a look at the library that allows acces to the database. And make sure that the database is actually present!
C++ Standard doesn't has native database support. You cannot connect to a database using C++ without database/platform specific libraries. Such as this or this one, if you want to connect to MySQL server.
精彩评论