Click here to Skip to main content
15,884,472 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
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 
vital_parsley2000 wrote:
But instead of this can i delete the record using sql query and then move to the next record ?


The term 'next record' has no meaning unless you've selected a bunch of records into a recordset. What I thought you had done (and would suggest you do) is select the records you are interested in (using a SELECT statement) into a record-set. Then the user can delete a record if they choose to (using the record-set's delete method, as I showed you) and you can move on to the record-set's next record. The record-set would be declared at class scope, so it is persistent across event handlers. Something like this (obviously this is a bare-bones sketch of what you'd use):

class MyDoc
{
   // other declarations
   _RecordsetPtr pRs;
  void SelectRecords(parameters) { /* create and initialise record-set */ }
};

class MyView
{
   void DisplayRecord() { /* Display the current record in GetDocument()->pRs; }
   void OnNextRecordButtonPressed() ( GetDocument()->pRs->MoveNext(); DisplayRecord(); }
   void OnDeleteRecordButtonPressed() ( GetDocument()->pRs->Delete(adAffectCurrent); OnNextRecordButtonPressed(); }
};


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

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 
GeneralRe: using Hotkeys Pin
Hamid_RT22-May-09 23:32
Hamid_RT22-May-09 23:32 
AnswerRe: using Hotkeys Pin
Hamid_RT22-May-09 23:32
Hamid_RT22-May-09 23:32 

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.