MySQL Forums
Forum List  »  Connector/C++

Connector/C++ (1.1.7 and 1.1.8) : crashes on executeQuery and execute in Visual Studio 2012
Posted by: ererz grgg
Date: April 12, 2017 12:40AM

Hi everyone,

I am pretty new to mysql, but after few hours of research on the Internet I didn't find a solution to my problem.

I installed Mysql (server 5.7 and connector/c++) and configured a first database with one table.

However, following the tutorial, my program crash completely when I try to use execute or executeQuery.

Here is the code :

sql::mysql::MySQL_Driver *driver;
sql::Connection *connection;
sql::Statement *stmt;

driver = sql::mysql::get_mysql_driver_instance();
connection = driver->connect("tcp://127.0.0.1:3306", "root" , "123");
stmt = connection->createStatement();
stmt->executeQuery("USE myDatabase");
stmt->executeQuery("INSERT INTO myTable VALUES (NULL, 1, 307 , 'S')");

It crashes at the first execute (USE...)

As it's pretty basic so I don't get why it doesn't work. The include and dll/lib are correctly linked. As a proof, after creating the connection and using isValid() method works well and confirms there is a connection.

Thank you for your help

Options: ReplyQuote


Subject
Views
Written By
Posted
Connector/C++ (1.1.7 and 1.1.8) : crashes on executeQuery and execute in Visual Studio 2012
1186
April 12, 2017 12:40AM


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.