hi all , i need your help ..... how to connect from visual studio c++ 6.0 to mysql?? please tell me , i need this.
Printable View
hi all , i need your help ..... how to connect from visual studio c++ 6.0 to mysql?? please tell me , i need this.
You can use the CDatabase and CRecordset classes to connect to any datasource.
foregzample i have some variable and i wont to write it in mysql , can u show me example?? thank you beforehand
No, we don't want to do the work for you.
If you search for the CDatabase class or the CRecordset class you will find detailed descriptions including working examples.
If you encounter a certain problem using it feel free to ask here again.
With regards
Programartist
- Open a database using CDatabase::OpenEx
- Create a SQL statement to INSERT INTO .... (or to UPDATE ...) data in your DB
- Use CDatabase::ExecuteSQL to write your new data to the DB
Have also a look at this thread.
Alternatively, you can try http://www.codeguru.com/cpp/data/mfc...le.php/c10041/
It looks like you need some introduction to database applications.
First of all, "write a variable in mysql" sounds senseless. A variable in C/C++ program is a memory region, but database never deals with variables directly. It's always required to establish some rule for putting/getting a variable to/from database. And details of the briging between both sides will depend on (more) the database scheme and (less) the database connectivity library/framework. Actually, there are lots of ways to put some value to some database, and correspondingly, there are lots of other factors and aspects that will affect the final choice. Previously recommended CDatabase class implies you mainly deal with ODBC (driver, DSN and the other stuff). But you may go with native MySQL library, or some other way you prefer. So, the thing is to become able to prefer something, that means "to gain some basic knowlege and skills" in more than one way of doing the thing. And please, do not expect somebody doing that choice for you.The same way, you definitely can expect anybody here will be glad to answer any of your concrete questions and share his experience.
Now it's the time for start asking.