CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9

Thread: hi all

  1. #1
    Join Date
    Jun 2009
    Posts
    8

    hi all

    hi all , i need your help ..... how to connect from visual studio c++ 6.0 to mysql?? please tell me , i need this.

  2. #2
    Join Date
    Sep 2004
    Location
    Holland (land of the dope)
    Posts
    4,123

    Re: hi all

    You can use the CDatabase and CRecordset classes to connect to any datasource.

  3. #3
    Join Date
    Jun 2009
    Posts
    8

    Re: hi all

    foregzample i have some variable and i wont to write it in mysql , can u show me example?? thank you beforehand

  4. #4
    Join Date
    May 2006
    Location
    Dresden, Germany
    Posts
    458

    Re: hi all

    Quote Originally Posted by lasha View Post
    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
    Last edited by ProgramArtist; June 26th, 2009 at 07:01 AM. Reason: typo...

  5. #5
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,430

    Re: hi all

    • 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.
    Victor Nijegorodov

  6. #6
    Join Date
    Jun 2009
    Posts
    8

    Re: hi all

    Quote Originally Posted by VictorN View Post
    • 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.
    thank U

  7. #7
    Join Date
    Jun 2009
    Posts
    8

    Re: hi all

    Quote Originally Posted by ProgramArtist View Post
    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
    thanks

  8. #8
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,244

    Re: hi all

    Ovidiu
    "When in Rome, do as Romans do."
    My latest articles: https://codexpertro.wordpress.com/

  9. #9
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,633

    Re: hi all

    Quote Originally Posted by lasha View Post
    foregzample i have some variable and i wont to write it in mysql , can u show me example?? thank you beforehand
    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.
    Best regards,
    Igor

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured