Unfortuntely, I have an entire system where this format of select is used in many programs and most of the files contain primary key comprised of multiple fields. I was hoping there would have been a simpler solution when accessing MS-SQL tables. Similarly, I have these lines of codes which are performed from multiple programs. It is a common subroutine but execute the same way as reported in this post. I am looking for a simple solution other than replacing the subroutine to use SQL syntax, Can you advise in this. Here are the lines.
43000 NOTES_EXIST:! ^1000 Check for existing customer notes"
43010 SETERR NOTES_EXIST_EXIT
43020 IF NOT(SUNOT1) THEN LET SUNOT1=UNT; OPEN (SUNOT1,IOL=*,REC=SUNOT1$)%C$+"sunot1"
43030 LET BTN_CUSNOT.CTL'TEXT$=MSG("notes.4"),BTN_CUSNOT.CTL'TIP$=MSG("notes.6"),BTN_CUSNOT.CTL'MSG$=MSG("notes.7")
43040 READ (SUNOT1,KEY=%CUSNOT_KEY$,DOM=*NEXT)
43050 LET SUNOT1_K$=KEY(SUNOT1,END=*RETURN)
43060 IF MID(SUNOT1_K$,1,%CUSLEN)=%CUSNOT_KEY$ THEN LET BTN_CUSNOT.CTL'TEXT$=MSG("notes.5"),BTN_CUSNOT.CTL'TIP$=MSG("notes.8"),BTN_CUSNOT.CTL'MSG$=MSG("notes.9")