Quantcast
Channel: MySQL Forums - Connector/C++
Viewing all articles
Browse latest Browse all 527

Connector/C++ (1.1.7 and 1.1.8) : crashes on executeQuery and execute in Visual Studio 2012 (1 reply)

$
0
0
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

Viewing all articles
Browse latest Browse all 527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>