I am trying to add records to my ODBC MFC program and am using this code
void CPersonalView::OnNewaddress()
{
if(!CPersonalSet.Open())
return FALSE;
if(!CPersonalSet.CanAppend())
return FALSE; // No field values were set
!CPersonalSet.AddNew();
!CPersonalSet.m_Birthdate = strBirthdate;
!CPersonalSet.m_Email = strEmail;
!CPersonalSet.m_First_Name = strFirstName;
!CPersonalSet.m_Last_Name = strLastName;
!CPersonalSet.m_Middle_Initial = strMiddleInitial;
!CPersonalSet.m_Nickname = strNickname;
if(!CPersonalSet.Update())
{
AfxMessageBox("Record not added; no field values were set."
return FALSE;
}
}
then i get the error of this:
C:\Program Files\Microsoft Visual Studio\My Projects\AddBookDB\PersonalView.cpp(253) : error C2275: 'CPersonalSet' : illegal use of this type as an expression
c:\program files\microsoft visual studio\my projects\addbookdb\personalset.h(12) : see declaration of 'CPersonalSet'
i understand what the error means but i dont understand how to fix it. If you can help it i would greatly appreciate it.
Tim,
Currently Studying in High School
void CPersonalView::OnNewaddress()
{
if(!CPersonalSet.Open())
return FALSE;
if(!CPersonalSet.CanAppend())
return FALSE; // No field values were set
!CPersonalSet.AddNew();
!CPersonalSet.m_Birthdate = strBirthdate;
!CPersonalSet.m_Email = strEmail;
!CPersonalSet.m_First_Name = strFirstName;
!CPersonalSet.m_Last_Name = strLastName;
!CPersonalSet.m_Middle_Initial = strMiddleInitial;
!CPersonalSet.m_Nickname = strNickname;
if(!CPersonalSet.Update())
{
AfxMessageBox("Record not added; no field values were set."
return FALSE;
}
}
then i get the error of this:
C:\Program Files\Microsoft Visual Studio\My Projects\AddBookDB\PersonalView.cpp(253) : error C2275: 'CPersonalSet' : illegal use of this type as an expression
c:\program files\microsoft visual studio\my projects\addbookdb\personalset.h(12) : see declaration of 'CPersonalSet'
i understand what the error means but i dont understand how to fix it. If you can help it i would greatly appreciate it.
Tim,
Currently Studying in High School