From: Warren Young Date: February 27 2007 3:54am Subject: Re: How to overcome a runtime error when there is no matching in database List-Archive: http://lists.mysql.com/plusplus/6384 Message-Id: <45E3AB6A.7070408@etr-usa.com> MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1250; format=flowed Content-Transfer-Encoding: 7bit Bassam A. Al-Khaffaf wrote: > > Cout << attributesList.lower_bound(_ATTRIBUTES_LIST(attribute_id, > vendor_id))->attribute_name << endl; > > However, I am getting a runtime error when there is no (attribute_id, > vendor_id) matching in my database so how can I control or overcome this > error. What's wrong with this: if (attributesList.size()) { cout .... etc. } else { cerr << "No results found" << endl; } ??