logo       

Sponsor
FREE Network Mapping Tool for Microsoft® Office Visio® Professional 2007
Don't map your network by hand - let LANsurveyor Exx press for Microsoft Visio Professional 2007 automatically create network diagrams for you!

Help with BadQuery Exception: msg#00065

db.mysql.c++

Subject: Help with BadQuery Exception

Hi all,

I am getting a "BadQuery" exception thrown _*every time*_ I send in this statement:

"select * from signature;"

I am on an XP box running MySQL++ ver: 1.7.32
I am running MySQL ver: 4.1

I know the command is valid. I use MySQL Query Browser for this windows env to test the command and it executes perfectly!!!! Both with and without the ; added.

The command in code that I use to execute the above statement is one of the following:

************************** 1 **********************************************
m_pqryQuery->reset();


// Put SQL Cmd into the Query Object.
//
try{
*m_pqryQuery << p_strSqlCmd;
cout << "Query: " << m_pqryQuery->preview() << endl;
string s = m_pqryQuery->preview();
g_cembMsgBox.m_vMsg("preview: " + s);
}
catch (exception &e)
{
string s=e.what();
s.append(" Unable to Set Up SQL Statement Properly");
elog.put("CTableStructs::m_iExecuteSingleSqlCmdStoreResults", s );
g_cembMsgBox.m_vMsg("m_intExecuteSingleSqlCmdStoreResults:: Exception! with Query Construction\n");
return g_intCANTCONSTRUCTQRY;
};


// Execute the query and store the results w/in the Parameter m_rltResult
//
try{
m_rltResults = m_pqryQuery->store();
i_numrows = m_rltResults.size();
}
catch (BadQuery &er)
{
//elog.put("CTableStructs::m_iExecuteSingleSqlCmdStoreResults", er.what());
//string s = "CDatabaseInterface:: Bad Query: [" + er.error +"]";
//g_cembMsgBox.m_vMsg(s);
return g_intBADQUERY;
} // catch sql cmd error

************************* 1 **********************************************




************************** 2 **********************************************
m_pqryQuery->reset();

try{
*m_pqryQuery << p_strSqlCmd;
cout << "Query: " << m_pqryQuery->preview() << endl;
string s = m_pqryQuery->preview();
g_cembMsgBox.m_vMsg(s);
}
catch (exception &e)
{
string s=e.what();
s.append(" Unable to Set Up SQL Statement Properly");
elog.put("CTableStructs::m_iExecuteSingleSqlCmdNoResults", s );
g_cembMsgBox.m_vMsg("m_intExecuteSingleSqlCmdStoreResults:: Exception! with Query Construction\n");
return g_intCANTCONSTRUCTQRY;
};


// Execute the query and store the results w/in the Parameter m_rltResult
//
try{
m_pqryQuery->execute();
i_numrows = 0;
}
catch (BadQuery &er)
{
//elog.put("CTableStructs::m_iExecuteSingleSqlCmdNoResults", er.what());
//string s = "CDatabaseInterface:: Bad Query: [" + er.error +"]";
//g_cembMsgBox.m_vMsg(s);
return g_intBADQUERY;
} // catch sql cmd error

************************** 2 **********************************************

Could someone please help me? I really need to understand this "error" which is NOT an error.

Everything is set up correctly and yes I know that executing "m_pqryQuery->execute();" results in NO RESULTS but still I get the exception thrown and I really don't understand.

Any help will be greatly appreciated. Thank you ahead of time!

--
Sincerely, Allen

Gene Allen Saucier, Jr
Senior Software Engineer
CAS, Inc
100 Quality Circle
Huntsville, AL 35806
or
PO Box 11190
Huntsville, AL 35814
(256) 922-6453 (w)




Only community members can participate in forum threads. You must Register or log in to contribute.

<Prev in Thread] Current Thread [Next in Thread>
Sponsor
FREE Network Mapping Tool for Microsoft® OfficeVisio Professional 2007
Don't map your network by hand - let LANsurveyor Express for Microsoft Visio Professional 2007
automatically create network diagrams for you!
Google Custom Search

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation

Home | sitemap | advertise | OSDir is an inevitable website. super tiny logo