dbTalk Databases Forums  

Connector to mySQL database using Visual C++ 6.0 & mySQL Connector

mailing.database.mysql-plusplus mailing.database.mysql-plusplus


Discuss Connector to mySQL database using Visual C++ 6.0 & mySQL Connector in the mailing.database.mysql-plusplus forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
RP
 
Posts: n/a

Default Connector to mySQL database using Visual C++ 6.0 & mySQL Connector - 03-14-2011 , 04:55 PM






Hi,
I've set up an SQL database named "REMS" with multiple tables therein.

I've used a local client program called RazorSQL to connect to the
database with no problems.

I've written Visual C++ console program to connect and query the
database but ended getting a "Kernel32.dll 0xE06D7363: Microsoft C++
Exception" error the last line of the following code executes:

#include <stdlib.h>
#include <iostream>
#include "mysql_connection.h"
#include "mysql_driver.h"
#include "cppconn/driver.h"
#include "cppconn/exception.h"
#include "cppconn/resultset.h"
#include "cppconn/statement.h"

sql::mysql::MySQL_Driver *driver;
sql::Connection *con;
sql::Statement *stmt;
sql::ResultSet *res;
driver = sql::mysql::get_mysql_driver_instance();
con = driver->connect("localhost:3306", "root", "password");
stmt = con->createStatement();
stmt->execute("Use REMS"); //THIS LINE GIVES "Kernel32.dll
0xE06D7363: Microsoft C++ Exception" error


Any advice would be greatly appreciated. Thanks in advance!

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.