Click here to Skip to main content
15,892,674 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionSimulate Keypress on a window Pin
nitin323-May-09 3:26
nitin323-May-09 3:26 
AnswerRe: Simulate Keypress on a window Pin
Stuart Dootson23-May-09 4:32
professionalStuart Dootson23-May-09 4:32 
QuestionMoveNext ( ) Pin
vital_parsley200023-May-09 0:58
vital_parsley200023-May-09 0:58 
AnswerRe: MoveNext ( ) Pin
Stuart Dootson23-May-09 1:55
professionalStuart Dootson23-May-09 1:55 
GeneralRe: MoveNext ( ) Pin
vital_parsley200023-May-09 2:26
vital_parsley200023-May-09 2:26 
GeneralRe: MoveNext ( ) Pin
Stuart Dootson23-May-09 3:13
professionalStuart Dootson23-May-09 3:13 
GeneralRe: MoveNext ( ) Pin
vital_parsley200023-May-09 4:11
vital_parsley200023-May-09 4:11 
GeneralRe: MoveNext ( ) Pin
Stuart Dootson23-May-09 4:24
professionalStuart Dootson23-May-09 4:24 
I've just looked at your code properly - I presume pRS is a member of a class somewhere whose cursor points at the current record that a) you're displaying, and b) you want to delete?

If so, then this should work:

void CSimpdbView::OnRecordsDelete() 
{
   int val = MessageBox("This deletes the record.Continue ?",NULL,MB_OKCANCEL);
   if(val == IDOK)
   {
      try
      {
         pRs->Delete(adAffectCurrent);
         MessageBox("Record Deleted !",NULL,MB_OK);
         pRs->MoveNext(); //Should move to the next reccord !
      }

      catch(_com_error &e)
      {
         TRACE( "Error:%08lx.\n", e.Error());
         TRACE( "ErrorMessage:%s.\n", e.ErrorMessage());
         TRACE( "Source:%s.\n", (LPCTSTR) _bstr_t(e.Source()));
         TRACE( "Description:%s.\n", (LPCTSTR)_bstr_t(e.Description()));
      }
      catch(...)
      {
         TRACE("\n****Unhandled Exception****\n");
      }
   }
}


Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

GeneralRe: MoveNext ( ) Pin
vital_parsley200023-May-09 4:46
vital_parsley200023-May-09 4:46 
GeneralRe: MoveNext ( ) Pin
Stuart Dootson23-May-09 5:04
professionalStuart Dootson23-May-09 5:04 
General[Message Deleted] Pin
vital_parsley200024-May-09 21:07
vital_parsley200024-May-09 21:07 
GeneralRe: MoveNext ( ) Pin
Stuart Dootson25-May-09 0:40
professionalStuart Dootson25-May-09 0:40 
GeneralRe: MoveNext ( ) Pin
vital_parsley200025-May-09 5:09
vital_parsley200025-May-09 5:09 
QuestionCueBanner in vc6 Pin
ganesh.dp23-May-09 0:49
ganesh.dp23-May-09 0:49 
AnswerRe: CueBanner in vc6 Pin
Stuart Dootson23-May-09 1:51
professionalStuart Dootson23-May-09 1:51 
QuestionDial up Network Connection status dialog. Pin
birajendu23-May-09 0:39
birajendu23-May-09 0:39 
AnswerRe: Dial up Network Connection status dialog. Pin
Hamid_RT23-May-09 1:26
Hamid_RT23-May-09 1:26 
GeneralRe: Dial up Network Connection status dialog. Pin
birajendu23-May-09 1:53
birajendu23-May-09 1:53 
QuestionSocket programming Pin
rajeshbhushetty23-May-09 0:34
rajeshbhushetty23-May-09 0:34 
AnswerRe: Socket programming Pin
Rajesh R Subramanian23-May-09 0:42
professionalRajesh R Subramanian23-May-09 0:42 
AnswerRe: Socket programming Pin
Stuart Dootson23-May-09 1:41
professionalStuart Dootson23-May-09 1:41 
Questionusing Hotkeys Pin
jalsa G22-May-09 21:14
jalsa G22-May-09 21:14 
AnswerRe: using Hotkeys Pin
Rajesh R Subramanian22-May-09 21:28
professionalRajesh R Subramanian22-May-09 21:28 
GeneralRe: using Hotkeys Pin
jalsa G22-May-09 21:48
jalsa G22-May-09 21:48 
GeneralRe: using Hotkeys Pin
Rajesh R Subramanian22-May-09 23:06
professionalRajesh R Subramanian22-May-09 23:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.