
November 12th, 2002, 06:51 PM
|
|
Junior Member
|
|
Join Date: Nov 2002
Posts: 11
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
CRecordset and CDatabase problem
I have been trying to get a test db program to work.
Here is the proposed function for adding a record. This is not working at all... guidance is apprectiated.
Thanks
void CContactDBView::OnButtonAdd()
{
// TODO: Add your control notification handler code here
if(!m_pSet->IsOpen())
MessageBox("Database not open!");
if(!m_pSet->CanAppend())
MessageBox("Can't append to database");
m_pSet->AddNew();
m_pSet->m_Lastname = Lastname;
m_pSet->m_Firstname = Firstname;
m_pSet->m_email = email;
m_pSet->m_Notes = Notes;
m_pSet->m_Phone = Phone;
if(!m_pSet->Update())
MessageBox("Database NOT UPDATED!");
}
|