Click here to Skip to main content
15,887,328 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Const VS Defines Pin
Albert Holguin18-Feb-15 8:42
professionalAlbert Holguin18-Feb-15 8:42 
GeneralRe: Const VS Defines Pin
Daniel Pfeffer18-Feb-15 21:53
professionalDaniel Pfeffer18-Feb-15 21:53 
GeneralRe: Const VS Defines Pin
Stefan_Lang18-Feb-15 22:22
Stefan_Lang18-Feb-15 22:22 
GeneralRe: Const VS Defines Pin
Daniel Pfeffer18-Feb-15 22:50
professionalDaniel Pfeffer18-Feb-15 22:50 
GeneralRe: Const VS Defines Pin
Stefan_Lang19-Feb-15 0:33
Stefan_Lang19-Feb-15 0:33 
GeneralRe: Const VS Defines Pin
Stefan_Lang18-Feb-15 22:08
Stefan_Lang18-Feb-15 22:08 
AnswerRe: Const VS Defines Pin
den2k8818-Feb-15 22:52
professionalden2k8818-Feb-15 22:52 
QuestionAdd Record in MySQL Pin
Django_Untaken16-Feb-15 3:22
Django_Untaken16-Feb-15 3:22 
Hello there. I am trying to insert record in mysql database using c++ ("sakila.actor"). Problem is, if I hardcode my table name (using double quotes) then it works fine, otherwise it gives runtime exception. Here is the code
void MyAppDlg::InsertRecord(CString sHostWithPort, CString sUser, CString sPassword, CString sTableName, int nActorId, CString sFirstName, CString sLastName, CString sLastUpdate)
{
	sql::Driver *driver;
	sql::Connection *con;
	sql::PreparedStatement *pstmt;

	driver = get_driver_instance();
	con = driver->connect(sHostWithPort.GetString(), sUser.GetString(), sPassword.GetString());

	con->setSchema(sTableName.GetBuffer()); // UNHANDLED EXCEPTION .... AT MEMORY LOCATION

        ///// rest of the code down below. e.g. preparing and executing statment

}


Two questions:

1- driver->connect(...); function is compiling with no problem but why con->setSchema(....); is producing exception.

2- How do I get all database names and table names using prepared statements.

Thanks for any pointer.
AnswerRe: Add Record in MySQL Pin
Richard Andrew x6416-Feb-15 5:25
professionalRichard Andrew x6416-Feb-15 5:25 
AnswerRe: Add Record in MySQL Pin
Jochen Arndt16-Feb-15 6:02
professionalJochen Arndt16-Feb-15 6:02 
Question'RegisterClass' - MS Documentation Error? Pin
Bram van Kampen15-Feb-15 14:39
Bram van Kampen15-Feb-15 14:39 
AnswerRe: 'RegisterClass' - MS Documentation Error? Pin
Richard Andrew x6415-Feb-15 16:28
professionalRichard Andrew x6415-Feb-15 16:28 
GeneralRe: 'RegisterClass' - MS Documentation Error? Pin
Bram van Kampen15-Feb-15 18:17
Bram van Kampen15-Feb-15 18:17 
AnswerRe: 'RegisterClass' - MS Documentation Error? Pin
Daniel Pfeffer15-Feb-15 20:32
professionalDaniel Pfeffer15-Feb-15 20:32 
AnswerRe: 'RegisterClass' - MS Documentation Error? Pin
Richard MacCutchan15-Feb-15 21:54
mveRichard MacCutchan15-Feb-15 21:54 
GeneralRe: 'RegisterClass' - MS Documentation Error? Pin
Bram van Kampen15-Feb-15 22:51
Bram van Kampen15-Feb-15 22:51 
GeneralRe: 'RegisterClass' - MS Documentation Error? Pin
Richard MacCutchan15-Feb-15 23:02
mveRichard MacCutchan15-Feb-15 23:02 
QuestionChange EditBox Font in MFC Pin
Janani9314-Feb-15 5:50
Janani9314-Feb-15 5:50 
AnswerRe: Change EditBox Font in MFC Pin
Richard MacCutchan14-Feb-15 21:23
mveRichard MacCutchan14-Feb-15 21:23 
GeneralRe: Change EditBox Font in MFC Pin
Janani9315-Feb-15 2:43
Janani9315-Feb-15 2:43 
GeneralRe: Change EditBox Font in MFC Pin
Richard MacCutchan15-Feb-15 2:51
mveRichard MacCutchan15-Feb-15 2:51 
GeneralRe: Change EditBox Font in MFC Pin
Bram van Kampen15-Feb-15 15:04
Bram van Kampen15-Feb-15 15:04 
Questionsteganography source code in c Pin
Member 1144386110-Feb-15 23:04
Member 1144386110-Feb-15 23:04 
SuggestionRe: steganography source code in c Pin
Jochen Arndt10-Feb-15 23:17
professionalJochen Arndt10-Feb-15 23:17 
AnswerRe: steganography source code in c Pin
Chris Losinger11-Feb-15 5:07
professionalChris Losinger11-Feb-15 5:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.