Author: wyoung
Date: Tue Jul 22 19:21:49 2008
New Revision: 2313
URL: http://svn.gna.org/viewcvs/mysqlpp?rev=2313&view=rev
Log:
Fixed loops in VC++ GUI examples for iterating through result sets to
work with MySQL++ v3: can no longer index past the end of results to
detect end of results.
Modified:
trunk/examples/vstudio/mfc/mfc_dlg.cpp
trunk/examples/vstudio/wforms/MainForm.h
Modified: trunk/examples/vstudio/mfc/mfc_dlg.cpp
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/examples/vstudio/mfc/mfc_dlg.cpp?rev=2313&r1=2312&r2=2313&view=diff
==============================================================================
--- trunk/examples/vstudio/mfc/mfc_dlg.cpp (original)
+++ trunk/examples/vstudio/mfc/mfc_dlg.cpp Tue Jul 22 19:21:49 2008
@@ -156,9 +156,8 @@
if (res) {
// Display the result set
- mysqlpp::Row row;
- for (mysqlpp::Row::size_type i = 0; row = res.at(i); ++i) {
- if (ToUCS2(awcTempBuf, kTempBufSize, row.at(0))) {
+ for (size_t i = 0; i < res.num_rows(); ++i) {
+ if (ToUCS2(awcTempBuf, kTempBufSize, res[i][0])) {
AddMessage(awcTempBuf);
}
}
Modified: trunk/examples/vstudio/wforms/MainForm.h
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/examples/vstudio/wforms/MainForm.h?rev=2313&r1=2312&r2=2313&view=diff
==============================================================================
--- trunk/examples/vstudio/wforms/MainForm.h (original)
+++ trunk/examples/vstudio/wforms/MainForm.h Tue Jul 22 19:21:49 2008
@@ -103,9 +103,8 @@
if (res) {
// Display the result set
- mysqlpp::Row row;
- for (mysqlpp::Row::size_type i = 0; row =
res.at(i); ++i) {
- AddMessage(ToUCS2(row.at(0)));
+ for (size_t i = 0; i < res.num_rows(); ++i) {
+ AddMessage(ToUCS2(res[i][0]));
}
// Retreive was successful, so save user inputs
now
_______________________________________________
Mysqlpp-commits mailing list
[email protected]
https://mail.gna.org/listinfo/mysqlpp-commits