Mailing List
Home
Forum Home
MySQL General - General MySQL discussion
MySQL++ - Programming with the C++ API to MySQL
MaxDB - Everything about MaxDB, formerly known as SAP DB
ODBC - ODBC with the MySQL Connector/ODBC driver
MySQL on Win32 - Runing MySQL on Windows 9x/Me/NT/2000/XP
Java Help - Mostly related to the MySQL Connector/J driver
Perl - Perl support for MySQL with DBI and DBD::mysql
GUI - MySQL GUI Tools
Announcement
Subjects
Subject: mysql openssl Question
ERROR 1045: Access denied for user: 'root@localhost ' (Using
password: NO)
Update one field with more fields from another table
Subject: Getting Identity after INSERT
ERROR 2002: Can 't connect to local MySQL server through socket
mysql test 4 1 fails with the gis test
Subject: MySQL Cluster Software
Downgrade Mysql from 4 to 3 23
Mysql 4 0 Oracle Stored Procedure Trigger Conversion
Can 't access mysql after kernel upgrade
Executing MySQL Commands From Within C Program
Comparing and writing out BLOBS
Subject: Re: Preventing Duplicate Entries
FULLTEXT query format question
Strange behavior, Table Level Permission
Does the binary log enabling affect the MySQL performances?
mysql:it 's a db not a dbms how it 's possible?!
mysql have same function mthod as Oracle decode()
 
Subject: Re: Problem with "mysqlpp:Result "

Subject: Re: Problem with "mysqlpp:Result "

2007-10-24       - By Guowen Han

 Back
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@(protected)>
10/24/2007 06:29 AM

To
plusplus@(protected)
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;
  }

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@(protected)




-- ---- ---- ---- ---- ---- ---- ---- ---
__ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ___
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.