Nicholson, Karen
knicholson at gpsx.net
Mon Sep 8 15:27:12 CDT 2003
You were right, I did have it bass ackwards. Made a bit of progress. With the code below, my procedure runs correctly (the second part) but I still can't get the first message, Records Not Updated to show. But I know it is not sql-ing it on me. I continue to sift through these books, I wrote the application in an hour, now just adding the little nice things is going to drive me to squiggly land. { if (Application->MessageBox("Warning - You are About to Update the Rebate Pay Field","Warning",MB_OKCANCEL) != IDOK) {(MessageBox,(NULL, "Records Not Updated", NULL, NULL)); } else { StoredProc1->Prepare(); StoredProc1->ExecProc(); } } -----Original Message----- From: James Barash [mailto:jbarash at bellatlantic.net] Sent: Monday, September 08, 2003 2:19 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]C++ Help I think you have your logic backwards. Your if statement is testing for Not IDOK for the true part of the if and IDOK for the else part. You should be testing for == IDOK James Barash -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com] On Behalf Of Nicholson, Karen Sent: Monday, September 08, 2003 2:53 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]C++ Help 6 squigleys, no error message, except I dont get my second message box stated in the else area. void __fastcall TfrmMainMenu::btnMarkPaidClick(TObject *Sender) { if (Application->MessageBox("Warning - You are About to Update the Rebate Pay Field","Warning",MB_OKCANCEL) != IDOK) {StoredProc1->Prepare(); StoredProc1->ExecProc(); } else { MessageBox,(NULL, "Records Not Updated", NULL, NULL); } } //---------------------------------------------------------------------- ---- - void __fastcall TfrmMainMenu::btnPayoutRptClick(TObject *Sender) { crpe2->ReportFileName = "c:\\KarenNicholson\\CPlusPlus\\QtrToDateRebatePay.rpt"; crpe2->PrintReport(); crpe2->PageZoom (100); } //---------------------------------------------------------------------- ---- - -----Original Message----- From: John Colby [mailto:jcolby at colbyconsulting.com] Sent: Monday, September 08, 2003 1:41 PM To: dba-sqlserver at databaseadvisors.com Subject: RE: [dba-SQLServer]C++ Help It's been too long but first you have an uneven number of open curly brackets { vs closed curly brackets. Second, shouldn't the leading open bracket be behind the if? John W. Colby www.colbyconsulting.com -----Original Message----- From: dba-sqlserver-bounces at databaseadvisors.com [mailto:dba-sqlserver-bounces at databaseadvisors.com]On Behalf Of Nicholson, Karen Sent: Monday, September 08, 2003 2:39 PM To: Dba-Sqlserver (E-mail) Subject: [dba-SQLServer]C++ Help Do we have a group for C++ Help? I am getting put through the learning curve ringer, but it is great. Went from SQL to VB6 now to C++. Only problems are those hiccups you get between languages, little things that add gray hair. This is my C++ code for an OK, CANCEL button: { if (Application->MessageBox("Warning - You are About to Update the Rebate Pay Field","Warning",MB_OKCANCEL) != IDOK) {StoredProc1->Prepare(); StoredProc1->ExecProc(); } else { MessageBox,(NULL, "Records Not Updated", NULL, NULL); } } I don't think it is working - I don't get the message box I expect if the user selects cancel. Any thoughts? _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com _______________________________________________ dba-SQLServer mailing list dba-SQLServer at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/dba-sqlserver http://www.databaseadvisors.com