Sami, That would work well I think. I'll try that. Thank you.
> -----Original Message----- > From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Sami Aaron > Sent: Thursday, March 17, 2005 12:57 PM > To: RBG7-L Mailing List > Subject: [RBG7-L] - Re: Create Error Code Table > > Claudine - > > What if you just do a quick count of records before you create the temp > view > and if the count is 0 then give your error message? > > SET V vCount INTEGER = 0 > SELECT COUNT(*) INTO vCount FROM <originaltable> WHERE <whereclause for > view> AND LIMIT = 1 > IF vCount = 0 THEN > PAUSE USING ..... > RETURN > ELSE > PRINT REPORT .... > ENDIF > > Sami > > -----Original Message----- > From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Claudine > Robbins > Sent: Thursday, March 17, 2005 12:41 PM > To: RBG7-L Mailing List > Subject: [RBG7-L] - Re: Create Error Code Table > > Thanks Razzak and Alastair, > > OK, we're getting closer. I have a listbox with an "on right click" eep > that creates a temporary view then prints a report based on the view. If > there is no data, there is no view, there is no report and more > importantly > there is no indication to the user that no records were found... I'm not > getting an error message just my form on the screen with no feedback > whatsoever. I want to be able to test some value such as sqlcode or > sqlstate (which is HY000 on succeeds and 00000 on fails - is that usable?) > to set my vmsg variable to show the user in a pau 2 using command that > there > were no records found. > > > -----Original Message----- > > From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of A. Razzak > > Memon > > Sent: Thursday, March 17, 2005 12:09 PM > > To: RBG7-L Mailing List > > Subject: [RBG7-L] - Re: Create Error Code Table > > > > > > At 12:38 PM 3/17/2005, Claudine Robbins wrote: > > > > >Hi everyone, > > > > > >I'm looking for the error code for "record not found" or > > >something like that to trap in a form. > > > > Claudine, > > > > Here's how: > > > > 01. -- CRobbins.EEP > > CLEAR VAR vRows, vCaption, vPauseMsg > > SET VAR vRows INTEGER = 0 > > SET VAR vCaption ' Just for fun!' > > SET VAR vPauseMsg = 'Record(s) Not Found!' > > SELECT COUNT(*) INTO vRows INDIC ivRows FROM TableName + > > WHERE whereclause ... > > IF vRows = 0 THEN > > CLS > > PAUSE 2 USING .vPauseMsg + > > CAPTION .vCaption + > > ICON STOP + > > BUTTON 'Press any key to continue ...' + > > OPTION BACK_COLOR WHITE + > > |MESSAGE_COLOR WHITE + > > |MESSAGE_FONT_COLOR RED + > > |BUTTON_COLOR WHITE > > GOTO TheEnd > > ELSE > > -- Do what you have to here .. > > ENDIF > > LABEL TheEnd > > CLEAR VAR iv%, vRows, vCaption, vPauseMsg > > RETURN > > > > 02. To suppress the: > > > > <WARNING> No rows exist or satisfy the clause > > > > Use the following technique: > > > > SET ERROR MESSAGE 2059 OFF > > SELECT selectclause FROM tableviewname ... + > > WHERE whereclause ... > > SET ERROR MESSAGE 2059 ON > > > > Hope that helps! > > > > Very Best R:egards, > > > > Razzak.
