General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Scan Hangs on Same Record
Environment versions
Network:
Windows 2000 Server
When I run the following code the Label output never moves past the second record but repeats second record over and over. The SPT returns 5 records. Now if I replace the LABEL line with a MESSAGEBOX if works correctly.
CASE p1 = 6
getPrintedTSOStringA = "Select Distinct whslc From amflib6.itembl Where (LENGTH(TRIM(itnbr)) < 15 Or RIGHT(itnbr,1) <> 'F') And whslc <> 'REJECT' And vndnr = '" + ALLTRIM(p2) + "' And mohtq <> 0 order By whslc"
IF SQLEXEC(tsoVARS.as400con, getPrintedTSOStringA, "getPrintedTSOQueryA") <> -1 Then
IF RECCOUNT("getPrintedTSOQueryA") > 0 Then
SCAN
tsoVars.whloc = getPrintedTSOQueryA.whslc
LABEL FORM purchasepartlabels3.lbx PREVIEW &&NOCONSOLE TO Printer
ENDSCAN
ELSE
RETURN .F.
EndIf
Else
If Aerror(odbcerrormsg) > 0 Then
MessageBox(odbcerrormsg(2))
EndIf
Return .F.
ENDIF
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only