Click here to Skip to main content
15,885,985 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I want to create a c++ program which basically asks the user to enter his username and password. If the username and password matches with the username and password stored in the database then the program lets the user enter. Now, i will be storing quite a number of usernames and password and i dont want to use a .txt file as a database. I want to learn the proper way such that if i need to store large amount of data then i can use an appropriate database. I have used mysql when i programmed in vb.net but i have never used sql database with c++. I want to use it with my c++ program. Is there a book that i can refer to or any links that can guide me to learn the steps required to understand the process of connecting a mysql/any other database to my c++ program. Thanks
**I am using Windows OS and Visual studio c++**
Posted
Updated 14-Oct-14 11:48am
v3
Comments
Sergey Alexandrovich Kryukov 14-Oct-14 17:40pm    
A book? At least you need to indicate your platform and other detail.
—SA
Surajit Das 14-Oct-14 17:49pm    
@Sergey Alexandrovich Kryukov:- Sorry! It was my mistake not to indicate those details. I am using Windows8 and Visual studio c++. Thanks for pointing out my mistake. I have also updated my question.

You can start, for example, here:
http://msdn.microsoft.com/en-us/library/kd4ck1tt.aspx[^],
http://dev.mysql.com/doc/connector-cpp/en/index.html[^].

Your post suggests that you are using Windows, but you did not indicate your platforms, database tools you are using, nothing. With such approach, even the best books may not be very helpful. You need to figure out what exactly do you want to use and what to achieve.

—SA
 
Share this answer
 
v2
Comments
Surajit Das 14-Oct-14 17:53pm    
@Sergey Alexandrovich Kryukov:- Thanks for your suggestion. I really appreciate it. Since, i am a beginner and i never worked with database in c++ before, is there any book which gives a more detailed insight into this topic?
Sergey Alexandrovich Kryukov 14-Oct-14 17:58pm    
I am not familiar with such books. I suggest you dig into the problem first, learn what's involved and the terminology and typical problem. Then go to the book store and do some Web search based on your experience and the problems you are facing. People learn more from on-line manuals though.

Do you know relational databases themselves, their design, relational model, schema, normal forms, SQL, and so on? It's a big piece of experience and knowledge...

Hope someone else can recommend you a book.

—SA
Surajit Das 14-Oct-14 18:06pm    
@SA- Thanks!
Sergey Alexandrovich Kryukov 14-Oct-14 18:54pm    
You are welcome. Will you accept the answer formally (green "Accept" button). In all cases, your follow-up or new questions will be welcome.
—SA
there are plenty of books out there on c++ and MySQL (*1) - although the best thing is

a) install MySQL and the c++ connector
b) read and work through the samples from the connector install

just do it .....

(*1 eg http://www.booktopia.com.au/managing-using-mysql-randy-jay-yarger/prod9780596002114.html?source=pla&gclid=CjwKEAjwk_OhBRD06abu3qSoxlwSJACt7sZ7rJ1Ls27Iico8FGtErPoQFC7K2Rbw33RUQuxfXJB8txoC_lXw_wcB[^] )

If you have even moderate funds, you can make your life easier by purchasing 'devart dotconnect' for example
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900