Click here to Skip to main content
15,564,935 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionMoveNext ( ) Pin
vital_parsley200023-May-09 1:58
vital_parsley200023-May-09 1:58 
AnswerRe: MoveNext ( ) Pin
Stuart Dootson23-May-09 2:55
professionalStuart Dootson23-May-09 2:55 
GeneralRe: MoveNext ( ) Pin
vital_parsley200023-May-09 3:26
vital_parsley200023-May-09 3:26 
GeneralRe: MoveNext ( ) Pin
Stuart Dootson23-May-09 4:13
professionalStuart Dootson23-May-09 4:13 
GeneralRe: MoveNext ( ) Pin
vital_parsley200023-May-09 5:11
vital_parsley200023-May-09 5:11 
GeneralRe: MoveNext ( ) Pin
Stuart Dootson23-May-09 5:24
professionalStuart Dootson23-May-09 5:24 
GeneralRe: MoveNext ( ) Pin
vital_parsley200023-May-09 5:46
vital_parsley200023-May-09 5:46 
GeneralRe: MoveNext ( ) Pin
Stuart Dootson23-May-09 6:04
professionalStuart Dootson23-May-09 6: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 22:07
vital_parsley200024-May-09 22:07 
GeneralRe: MoveNext ( ) Pin
Stuart Dootson25-May-09 1:40
professionalStuart Dootson25-May-09 1:40 
GeneralRe: MoveNext ( ) Pin
vital_parsley200025-May-09 6:09
vital_parsley200025-May-09 6:09 
QuestionCueBanner in vc6 Pin
ganesh.dp23-May-09 1:49
ganesh.dp23-May-09 1:49 
AnswerRe: CueBanner in vc6 Pin
Stuart Dootson23-May-09 2:51
professionalStuart Dootson23-May-09 2:51 
QuestionDial up Network Connection status dialog. Pin
birajendu23-May-09 1:39
birajendu23-May-09 1:39 
AnswerRe: Dial up Network Connection status dialog. Pin
Hamid_RT23-May-09 2:26
Hamid_RT23-May-09 2:26 
GeneralRe: Dial up Network Connection status dialog. Pin
birajendu23-May-09 2:53
birajendu23-May-09 2:53 
QuestionSocket programming Pin
rajeshbhushetty23-May-09 1:34
rajeshbhushetty23-May-09 1:34 
AnswerRe: Socket programming Pin
Rajesh R Subramanian23-May-09 1:42
professionalRajesh R Subramanian23-May-09 1:42 
AnswerRe: Socket programming Pin
Stuart Dootson23-May-09 2:41
professionalStuart Dootson23-May-09 2:41 
Questionusing Hotkeys Pin
jalsa G22-May-09 22:14
jalsa G22-May-09 22:14 
AnswerRe: using Hotkeys Pin
Rajesh R Subramanian22-May-09 22:28
professionalRajesh R Subramanian22-May-09 22:28 
GeneralRe: using Hotkeys Pin
jalsa G22-May-09 22:48
jalsa G22-May-09 22:48 
GeneralRe: using Hotkeys Pin
Rajesh R Subramanian23-May-09 0:06
professionalRajesh R Subramanian23-May-09 0:06 
GeneralRe: using Hotkeys Pin
Hamid_RT23-May-09 0:32
Hamid_RT23-May-09 0:32 
AnswerRe: using Hotkeys Pin
Hamid_RT23-May-09 0:32
Hamid_RT23-May-09 0: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.