MySQL connector/driver behaviour with Visual C++ CLR/CLI project

0

Hello. i'm having an issue getting the MySQL connector/driver to
behave proberly with a Visual C++ CLR/CLI project.... my issue is
best described by this screen capture: http://img97.imageshack.us/i/mysqlissue.jpg/

The host name that MySQL is trying to resolve is a series of strange
characters.... certainly not the "string" that is passed into the
connector function. The exception handler is saying: Unknown MySQL
server host 'U‹ìWVSÂì' (11004)... clearly it is not trying to
connect to tcp://bluetech

Has anyone see this? Could it have to do with language/character sets
or something? I've already tried: this->con = this->driver->connect
(L"tcp://bluetech:3306",L"SC",L"SC"); but, the connect function is
looking for a std::string.

Can someone please help me?

Thanks!
 
D

Dann Corbit

Hello. i'm having an issue getting the MySQL connector/driver to
behave proberly with a Visual C++ CLR/CLI project.... my issue is
best described by this screen capture: http://img97.imageshack.us/i/mysqlissue.jpg/

The host name that MySQL is trying to resolve is a series of strange
characters.... certainly not the "string" that is passed into the
connector function. The exception handler is saying: Unknown MySQL
server host 'U?ìWVSì' (11004)... clearly it is not trying to
connect to tcp://bluetech

Has anyone see this? Could it have to do with language/character sets
or something? I've already tried: this->con = this->driver->connect
(L"tcp://bluetech:3306",L"SC",L"SC"); but, the connect function is
looking for a std::string.

Guess: I wonder if you have the project type defined correctly.

Under the "Solution Properties"/General tab, check to see if character
set is what you want (you might try mbcs if it is unicode and that is
not what is wanted, for instance).

I guess that you will have better fortune asking VC++ specific questions
of this nature in one of the Microsoft programming groups.

HTH
 
M

Michael Foukarakis

Hello. i'm having an issue getting the MySQL connector/driver to
behave proberly with a Visual C++ CLR/CLI project....  my issue is
best described by this screen capture:http://img97.imageshack.us/i/mysqlissue.jpg/

The host name that MySQL is trying to resolve is a series of strange
characters.... certainly not the "string" that is passed into the
connector function.  The exception handler is saying: Unknown MySQL
server host 'U‹ìWVS ì  ' (11004)... clearly it is not trying to
connect to tcp://bluetech

Has anyone see this?  Could it have to do with language/character sets
or something?  I've already tried: this->con = this->driver->connect
(L"tcp://bluetech:3306",L"SC",L"SC");  but, the connect function is
looking for a std::string.

Can someone please help me?

Thanks!

You are hiding the driver's implementation, so there's not much to
say. I'll assume you're using the non-deprecated mysql_real_connect()
function to connect to a MySQL database; in that case, there's a lot
of mandatory parameters you might be missing in your call. Again,
based on the stripped-down interface you're showing, it's hard to
tell.

If you care to provide some more related info, we might be able to
help.

Cheers.
 
R

red floyd

Hello. i'm having an issue getting the MySQL connector/driver to
behave proberly with a Visual C++ CLR/CLI project....  my issue is
best described by this screen capture:http://img97.imageshack.us/i/mysqlissue.jpg/

The host name that MySQL is trying to resolve is a series of strange
characters.... certainly not the "string" that is passed into the
connector function.  The exception handler is saying: Unknown MySQL
server host 'U‹ìWVS ì  ' (11004)... clearly it is not trying to
connect to tcp://bluetech

Has anyone see this?  Could it have to do with language/character sets
or something?  I've already tried: this->con = this->driver->connect
(L"tcp://bluetech:3306",L"SC",L"SC");  but, the connect function is
looking for a std::string.

Can someone please help me?

Your best bet is to go to a group with microsoft and/or VC in it's
name.
C++/CLI is not -- despite what MS wishes -- C++. It's off-topic here,
as
are O/S specific issues.
 

0

Hello. i'm having an issue getting the MySQL connector/driver to
behave proberly with a Visual C++ CLR/CLI project....  my issue is
best described by this screen capture:http://img97.imageshack.us/i/mysqlissue.jpg/

The host name that MySQL is trying to resolve is a series of strange
characters.... certainly not the "string" that is passed into the
connector function.  The exception handler is saying: Unknown MySQL
server host 'U‹ìWVS ì  ' (11004)... clearly it is not trying to
connect to tcp://bluetech

Has anyone see this?  Could it have to do with language/character sets
or something?  I've already tried: this->con = this->driver->connect
(L"tcp://bluetech:3306",L"SC",L"SC");  but, the connect function is
looking for a std::string.

Can someone please help me?

Thanks!

just a follow up here. i used the .NET version of the MySQL
connector. that seemed to do the trick! the .NET connector uses the
System::String as the inbound parameters. this eliminates all the
language/character issues.

cheers
 
Joined
Sep 3, 2010
Messages
1
Reaction score
0
resources

Hi 0, thank you so much for posting. I have been trying to fix this error in my own code for days until I found this post.

I've installed the .NET connector but I am a C++ programmer and not a .NET programmer (I have a lot of experience in plain C++ but barely any in Visual C++) so I have no idea how to get started with this library since all the examples are in C#. Do you have any example code you'd be willing to share or any online resources that you found to be helpful when doing this?

Thanks! I really appreciate your time.

Lauren
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,954
Messages
2,570,114
Members
46,702
Latest member
VernitaGow

Latest Threads

Top