How to connect to a MySQL database via VC++ 2008?

I have a MySQL bug report database. Can I wire that to C++ and make a bug management tool for my IT staff? More importantly will I be able to change information in the database from Visual C++ 2008? I need to channel a certain field into a ListBox element in VC++.

Comments

  • I know you can in C# so I don't see why you couldn't do it in C++.

    Look under System.Data.OleDb namespace.

    you wanna do something like this

    System.Data.OleDb.OleDbConnection conn = new System.Data.OleDb.OleDbConnection( "connectionstring" );

    System.Data.OleDb.OleDbCommand com = new System.Data.OleDb.OleDbCommand( "select * from table" , conn);

    System.Data.OleDb.OleDbDataAdapter da = new System.Data.OleDb.OleDbDataAdapter( com );

    DataSet ds = new DataSet();

    da.Fill(ds);

    or you could use a datareader and a loop.

Sign In or Register to comment.