Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Re: Problem with "mysqlpp:Result"

From: Guowen Han <GHan(at)dtcc.com>
Date: Wed Oct 24 2007 - 08:31:24 EDT


There are two problems I can see.
1. there is no end control for variable i 2. res is a vector (i guess), res.at(i) will out of boundary when i is exceed the size

ALeX <logocomune@gmail.com>
10/24/2007 06:29 AM

To
plusplus@lists.mysql.com
cc

Subject
Problem with "mysqlpp:Result"

I have this little problem, if i use this code of exemple: if (res) {

                                 mysqlpp::Row row;
                                 mysqlpp::Row::size_type i;
                                 for (i = 0; row = res.at(i); ++i) {
                                                 cout << '\t' << row.at(0) 
<< endl;
                                 }
                 }

My executable stop with "This application has requested the Runtime to terminate it in an unusual way.Please contact the application's support team for more information."

I solve with this trick...
if (res) {

   mysqlpp::Row row;
   mysqlpp::Row::size_type i;
   for (i = 0; i < res.size(); ++i){

       row = res.at(i);
  out << '\t' << row.at(0) << endl;
   }

Do you need help?X

My question is why the first code rise errors?

-- 
MySQL++ Mailing List
For list archives: 
http://lists.mysql.com/plusplus
To unsubscribe:    
http://lists.mysql.com/plusplus?unsub=ghan@dtcc.com




-----------------------------------------
________________________________________________________
DTCC DISCLAIMER: This email and any files transmitted with it are
confidential and intended solely for the use of the individual or
entity to whom they are addressed. If you have received this email
in error, please notify us immediately and delete the email and any
attachments from your system. The recipient should check this email
and any attachments for the presence of viruses.  The company
accepts no liability for any damage caused by any virus transmitted
by this email.
Received on Wed Oct 24 08:35:38 2007

This archive was generated by hypermail 2.1.8 : Fri Jul 04 2008 - 00:21:38 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library