MySQL Forums
Forum List  »  Connector/C++

Beginner issue
Posted by: Mitxel Fuentes
Date: March 01, 2011 05:23AM

Hi all
i've been wasting some hours with my first try. I suppose it will be an easy issue for you.

This is my code, (very simple)

#include <mysql_driver.h>
#include <cppconn/connection.h>

int wmain()
{
sql::Driver *driver;
sql::Connection *con;

driver = get_driver_instance();
con = driver->connect("tcp://127.0.0.1:3306", "root", "root" );
delete con;

return 0;
}


No problems compiling and this error when it fails and i debug.

Unhandled exception at 0x53ab01dc in pruebaconnmysql.exe: 0xC0000005: Access violation reading location 0x00000000.

Problem is with connect function.


Enviroment (Wndows 7 + Microsoft Visual Studio 2010 Espress)

Thanks for your time and support

Options: ReplyQuote


Subject
Views
Written By
Posted
Beginner issue
2699
March 01, 2011 05:23AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.