Hey All,
I am executing the following query in a vbscript, it obviously pulls info from various tables:
strFilter ="SELECT A.PDDOCO, A.PDAN8, B.A6AN8, C.ABAN8, C.ABAN85, C.ABALPH, C.ABDC, B.A6TRAP FROM PRODDTA.F4311 A, PRODDTA.F0101 C, PRODDTA.F0401 B WHERE A.PDAN8 = C.ABAN8 AND C.ABAN85 = B.A6AN8 AND (A.PDLNID = 1000) AND { fn UCASE(a.PDDOCO) } LIKE '%62597%' ORDER BY a.PDDOCO"
I am getting an error populating my record set. Attached is the code where this happens....
On Error goto 0
objRS.Open strFilter, objConn
RecordCount = objRS.RecordCount
MsgBox "RecordCount = " & RecordCount
If RecordCount = -1 Then
RecordCount = 0
End If
MsgBox "strFilter = " & strFilter
Select Case RecordCount
Case 0
MsgBox "No PO Numbers matched - Reenter Purchase Order Number"
This.Flagged = True
Case 1
DPONumber.Value = Trim(objRS.Fields("a.PDDOCO"))
VendorName.Value = Trim(objRS.Fields("c.ABALPH"))
VendorID.Value = Trim(objRS.Fields("c.ABAN8"))
VendorIDAP.Value = Trim(objRS.Fields("c.ABAN85"))
Terms.Value = Trim(objRs.Fields("b.A6TRAP"))
There is a Case Else, but it produces the same error which is "Item cannot be found in the collection corresponding to the requested name or ordinal.
Anyone got any ideas? I know it's a script issue and the ODBC driver is correct. I think I need to employ a JOIN but do not know the syntax.
Thanks in Advance
Horse
I am executing the following query in a vbscript, it obviously pulls info from various tables:
strFilter ="SELECT A.PDDOCO, A.PDAN8, B.A6AN8, C.ABAN8, C.ABAN85, C.ABALPH, C.ABDC, B.A6TRAP FROM PRODDTA.F4311 A, PRODDTA.F0101 C, PRODDTA.F0401 B WHERE A.PDAN8 = C.ABAN8 AND C.ABAN85 = B.A6AN8 AND (A.PDLNID = 1000) AND { fn UCASE(a.PDDOCO) } LIKE '%62597%' ORDER BY a.PDDOCO"
I am getting an error populating my record set. Attached is the code where this happens....
On Error goto 0
objRS.Open strFilter, objConn
RecordCount = objRS.RecordCount
MsgBox "RecordCount = " & RecordCount
If RecordCount = -1 Then
RecordCount = 0
End If
MsgBox "strFilter = " & strFilter
Select Case RecordCount
Case 0
MsgBox "No PO Numbers matched - Reenter Purchase Order Number"
This.Flagged = True
Case 1
DPONumber.Value = Trim(objRS.Fields("a.PDDOCO"))
VendorName.Value = Trim(objRS.Fields("c.ABALPH"))
VendorID.Value = Trim(objRS.Fields("c.ABAN8"))
VendorIDAP.Value = Trim(objRS.Fields("c.ABAN85"))
Terms.Value = Trim(objRs.Fields("b.A6TRAP"))
There is a Case Else, but it produces the same error which is "Item cannot be found in the collection corresponding to the requested name or ordinal.
Anyone got any ideas? I know it's a script issue and the ODBC driver is correct. I think I need to employ a JOIN but do not know the syntax.
Thanks in Advance
Horse