hi

iam using Microsoft SQL Server 2000 but i cant delete data in my program.
Ican add, read but not deleter

The user permission is set to read, write, delete, update etc allows everying in Microsoft SQL 2000 Server. is something wrong in my code ??

Code:
void CListAllDlg::OnBnClickedDelete()
{
	CDatabase db;
	CCosmetik m_pData(&db);
	int nItem=0;
	CString m_ListItem="";

	//open Recordset
	m_pData.Open(CRecordset::none);

	POSITION pos = m_list_all.GetFirstSelectedItemPosition();

	if (MessageBox("Möchten Sie diesen Datensatz wirklich löschen?","Diesen Datensatz löschen?", MB_YESNO | MB_ICONQUESTION) == IDYES)
	{
		while (pos != NULL)
		{
			nItem = m_list_all.GetNextSelectedItem(pos);
			m_ListItem = m_list_all.GetItemText(nItem,1);

			//delete data
			while(!m_pData.IsEOF())
			{	
				//found data thend delete else move to next data
				if(strcmp(m_pData.m_articel,m_ListItem)==0)
				{
					if(m_pData.CanUpdate())
					{
						m_pData.Delete();			  //delete data in database
						m_list_all.DeleteItem(nItem); //delete data in listbox
					}//end if
					else
					{
						AfxMessageBox("Produkt konnte nicht gelöscht werden", IDOK);
					}//end else
				}
				m_pData.MoveNext();
			}//end while			
		}//end while		
	}//end if
	
	//update and save data
	m_pData.Update();
	m_pData.Close();			

}//end OnBnClickedDelete


Can someone help