0

I have forgotten how to perform this function. I need to display only the records that meet the following criteria: I only want to show records that have a quantity greater than 100. Can someone help?

This is an MFC project using an ODBC database:

void CInventoryView::OnRecordQuantity() 
{
	// TODO: Add your command handler code here
 
 
	m_pSet->Close();
	m_pSet->m_strFilter = "Quantity";
	m_pSet->Open();
	int iQuantity = m_pSet->GetRecordCount();
		if (iQuantity > 100) {
			AfxMessageBox("No matching records found.");
			m_pSet->Close();
			m_pSet->m_strFilter = "[Quantity]";
			m_pSet->Open();
		}
		UpdateData(FALSE);

<< moderator edit: added

tags >>

2
Contributors
1
Reply
2
Views
12 Years
Discussion Span
Last Post by BountyX
0

Are you dealing with a List control, array, or something else?

If its an array, you should be able to go through the array with a simple loop.

*I think*
If its a list control you can use the SortListA() function to return an array with specified data attributes.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.