Bug #65387 [Visual Studio '08 C++ ] SEHException while try connect to db
Submitted: 22 May 2012 3:59 Modified: 12 Jul 2012 8:13
Reporter: Vladimir M Email Updates:
Status: No Feedback Impact on me:
None 
Category:Connector / C++ Severity:S1 (Critical)
Version:cppconn 1.0.5, MySQL 5.5.1 OS:Windows (win7x32)
Assigned to: Bogdan Degtyariov CPU Architecture:Any
Tags: cppconn, sehexception, Visual Studio

[22 May 2012 3:59] Vladimir M
Description:
Hi, i have code example from MySQL Connector/C++ manual, and i'm getting SEHException while try connect to db like this:

std::auto_ptr<sql::Connection> con(driver->connect("tcp://127.0.0.1:3307", "root", "qwerty"));

C++ project compiled properly, without warnings, and all lib's linked/included.
MySQL service working fine, so i can view tables in phpMyAdmin, etc.

Any suggestions?
Thanks.

How to repeat:
Full code:

#include "stdafx.h"
#include "Form1.h"

#include <stdlib.h>
#include <string>
#include <iostream>
#include <sstream>
#include <stdexcept>

#include "mysql_driver.h"
#include "mysql_connection.h"

#include <cppconn/driver.h>
#include <cppconn/exception.h>
#include <cppconn/resultset.h>
#include <cppconn/statement.h>
#include <cppconn/prepared_statement.h>

using namespace std;
using namespace sql::mysql;
using namespace testApp;

[STAThreadAttribute]
int main(array<System::String ^> ^args)
{

Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);

Form1 ^f = gcnew Form1();

try {

sql::Driver* driver = get_driver_instance();
std::auto_ptr<sql::Connection> con(driver->connect("tcp://127.0.0.1:3307", "root", "qwerty"));
} catch(Runtime::InteropServices::SEHException^ e){
MessageBox::Show( "Trace:"+e->Message,"DB Error", MessageBoxButtons::OK, MessageBoxIcon::Error);
}

Application::Run(f);
return 0;
};
[12 Jun 2012 8:13] Bogdan Degtyariov
Vladimir,

Did you try Connector/C++ 1.1.0?
It worked perfectly for me.

Also, linking your program using MySQL 5.5.1 is not a very good
idea because 5.5.1 was the early version even before the Release
Candidate.

You should try a recent version such as 5.5.25.
Please let me know the results.
[13 Jul 2012 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".