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

Hybrid View

  1. #1
    Join Date
    Aug 2009
    Posts
    3

    Trouble using MySql Connector C++

    Hey Fellow Coders,

    I am trying to get this -->http://blog.ulf-wendel.de/?p=215
    to run.

    I was able to get my code to compile.

    However, it seems that my code crashes every time in 1 spot and I have no idea why.

    Here is the code snippet where it crashes.

    try {
    sql:river *driver;
    sql::Connection *con;
    sql::Statement *stmt;
    sql::ResultSet *res;

    /* Create a connection */
    cout << "success ONE\n";
    driver = get_driver_instance();
    cout << "success TWO\n";
    con = driver->connect("tcp://localhost:3306", "root", "bingo"); <--------//CRASHES RIGHT HERE
    cout << "CONNECTED TO DATABASE\n";

    I have no idea what I am doing wrong.

    Can someone give me some pointers?

  2. #2
    Join Date
    Aug 2009
    Posts
    3

    Re: Trouble using MySql Connector C++

    Btw, I do have an active database running locally... So it shouldn't crash because of an inactive database.


    The error message I get is:
    Unhandled exception at 0x7855b690 (msvcr90.dll) in cpp_dynamic_client.exe: 0xC0000005: Access violation reading location 0xcccccccc.

  3. #3
    Join Date
    Aug 2009
    Posts
    3

    Re: Trouble using MySql Connector C++

    Nevermind! Got it to run!

    I just had to switch the program from running in Debug(active) mode into Release(active).

    Thanks anyway!

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