[RESOLVED] ERROR - VS 2012 MFC dialog based application connect with MYSQL
Hi,
I'm using VS 2012. Installed MYSQL 5.6, C++ Connector 1.1.3. Created a sample table using mysql. Now i like to create a connect between mysql and MFC dialog. Using this, i was try to connect.
Server Explorer -> Data Connection -> Add Connections ->MYSQL Database -> Addconnection
To get the connection, i want to enter the connection settings like:
server host name = localhost, user name =root, password=
if i pressed any letter in the keyboard means add connection dialog was colosed automatically.
Re: ERROR - VS 2012 MFC dialog based application connect with MYSQL
First i try to connect using this code But dialog based application instead of Console Application.
Kindly find the attchment. I already done this code in a console application with windows xp & VC6. Its worked.
Added C++
C:\Program Files\MySQL\MySQL Connector C++ 1.1.3\include
C:\Program Files\MySQL\MySQL Server 5.6\include
C:\Program Files\boost_1_55_0
Added Linker - > general
C:\Program Files\MySQL\MySQL Connector C++ 1.1.3\lib\opt
linked mysqlcppconn.lib
if not added C:\Program Files\boost_1_55_0 error occured like
fatel error C1083 can not open include file 'boost/variant.cpp' no such file or directory.
if added
1>------ Build started: Project: VCMysqlConn, Configuration: Release Win32 ------
stdafx.cpp
VCMysqlConn.cpp
VCMysqlConnDlg.cpp
c:\program files\mysql\mysql connector c++ 1.1.3\include\cppconn\sqlstring.h(38): warning C4251: 'sql::SQLString::realStr' : class 'std::basic_string<_Elem,_Traits,_Alloc>' needs to have dll-interface to be used by clients of class 'sql::SQLString'
with
[
_Elem=char,
_Traits=std::char_traits<char>,
_Alloc=std::allocator<char>
]
C:\Program Files\MySQL\MySQL Connector C++ 1.1.3\include\cppconn/exception.h(61): warning C4251: 'sql::SQLException::sql_state' : class 'std::basic_string<_Elem,_Traits,_Alloc>' needs to have dll-interface to be used by clients of class 'sql::SQLException'
with
[
_Elem=char,
_Traits=std::char_traits<char>,
_Alloc=std::allocator<char>
]
VCMysqlConnDlg.cpp(206): fatal error C1075: end of file found before the left brace '{' at VCMysqlConnDlg.cpp(177)' was matched
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Re: ERROR - VS 2012 MFC dialog based application connect with MYSQL
Well, you did something wrong since now system searches for the MzSQL functions not in mysqlcppconn.dll where they appear to be but in your own executable DLGDBCONN.exe.
Besides, why did you start with the release build rather than the debug one?
Re: ERROR - VS 2012 MFC dialog based application connect with MYSQL
Originally Posted by VictorN
why did you start with the release build rather than the debug one?
Yes I'm using release mode becos, Msdn tells
To avoid potential crashes, the build configuration of MySQL Connector/C++ should match the build configuration of the application using it. For example, do not use the release build of MySQL Connector/C++ with a debug build of the client application.
I was manually copied the lib files in the release folder and run my application, it was opened.
any solution for this error?
Last edited by saraswathisrinath; May 22nd, 2014 at 02:04 AM.
Reason: update soln
Re: ERROR - VS 2012 MFC dialog based application connect with MYSQL
I have both version of VS2003 & VS 2012 in my PC.
Compination of win 8 + VS 2012, mysql 5.6(32 bit), connector 1.1.3(32 bit) & Booster 1.55.0 -> No compile time error both mode(release & Debug). But run time error like The Application was unable to start correctly oxc000007b. click ok to close the application. in VS2012 console application.
If i was develop the same application in win 8 + VS2003 means, running good both mode(release & Debug).
My requirement is mysql data base connection with VS2012 Dialog based MFC application.
I reinstalled the 32 bit version mysql & Connector and installed the 64 bit version mysql 5.6 & connector 1.1.3. After setting, compile time error occured both debug mode & Release mode in VS2012 & VS2003.
Connection Failed HY000 MYSQL ODBC 5.2(a) Driver can't connect to MySQL server on 20.240.10.10 (10060)
how can I establish the handshaking between system1 & system2 ?
System1 used wireless connection & System2 used wired connection[Ethernet].
used the ipconfig command to get the IP address. any issue arise, for using IP instead of IP4 for server name.
Re: ERROR - VS 2012 MFC dialog based application connect with MYSQL
Man, it doesn't matter using what framework or application type you try to achieve this. What really matters is connectivity technology and database configuration. Both aspects are about MySQL, and this is what you should focus on. The sooner you understand this, the better you solve your issue.
Re: ERROR - VS 2012 MFC dialog based application connect with MYSQL
Originally Posted by Igor Vartanov
Man, it doesn't matter using what framework or application type you try to achieve this. What really matters is connectivity technology and database configuration. Both aspects are about MySQL, and this is what you should focus on. The sooner you understand this, the better you solve your issue.
Really i don't know how to solve this. so only i was post. Thanks Mr. Igor. I will try.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.