ODBC problems using Delete().... 
Author Message
 ODBC problems using Delete()....

Quote:

> Hello,  I am new with ODBC and have a simple problem with deleting
> records.
> I have to functions that add a record.  I can not delete the record
> added with
> on of the functions.

> The first function listed when used will let me delete the record that
> was added.

> void CTestView::OnRecordAdd()
> {
>         // If already in add mode, complete the previous new record
>         if (m_bAddMode)
>                 OnMove(ID_RECORD_FIRST);
>         m_pSet->AddNew();
>         m_bAddMode = TRUE;
>         UpdateData(FALSE);
>  }

> The following function will not let me delete the record if I use it to
> add
> records.  When I try to delete a record I get the following dialog:
>         No rows were affected by the update or delete operation.

> void CTestView::CreateNewRecord(char buffer[])
> {
>     char temp[MAX_SIZE];

>         m_pSet->AddNew();
>         m_bAddMode = TRUE;
>         UpdateData(FALSE);
> // some code was left out here
>         int letters=0;
>         for(int i=19; memcmp(&buffer[i], " ", 1)!=0; i++)
>           letters++;
>         memcpy(temp, &buffer[19], letters);
>         temp[letters] = '\0';
>         m_pSet->m_Last_Name = temp;

>         i = strlen(buffer);
>         memcpy(temp, &buffer[20+letters], i-(20+letters));
>         temp[i-(20+letters)] = '\0';
>         m_pSet->m_First_Name = temp;

>         UpdateData(FALSE);
>         OnMove(ID_RECORD_NEXT);
> }

> I am using VC++ 4.0, ODBC with a driver for Paradox.  My OS is WIN95. If
> you have a suggestion or idea I would like to hear about it.  Thank you
> for
> you time.

>   Steve Saunders


Call requery to update the set


Wed, 07 Jul 1999 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Unable to delete record using ODBC Jet DLL V4.x

2. Problem with ODBC Delete in Enroll Tutorial

3. ODBC 4.0 problem deleting records

4. Problem with ODBC Delete in Enroll Tutorial

5. Problem with ODBC Delete in Enroll Tutorial

6. Problem using delete with dialog-based MFC app

7. problem with delete, I'm using it wrong

8. Problem using delete with dialog-based MFC app

9. Problem using Delete method in ADOCE (eVC)

10. Help needed: problem in using odbc call to write binary data to SQL Server

11. Problem using ODBC and Jet Database

12. Problem Fetching Records in Bulk using MFC/ODBC/SQL Server

 

 
Powered by phpBB® Forum Software