Hello,
I have 2 recordsets from 2 tables.
For example:
tableJob has colN(john, mary, ken), colID(1, 2, 3), colType(A, B, C)
tableQuery has colID(1, 2, 3), colX(11, 3, 9), colY(3, 8, 16)
Do While Not jobRs.EOF
cnum4p = jobRs.Fields(0) 'value from colN
jobRs.MoveNext
Loop
Do While Not queryRs.EOF
snum4p = queryRs.Fields(0) 'value from colID
slpX = queryRs.Fields(1) - 2
slpY = queryRs.Fields(2) - 3
cPt = Point3dFromXY(slpX, slpY)
plotA3 cPt, 0, msdDrawingModeNormal, vw
queryRs.MoveNext
Loop
I'm getting values from tableQuery (with each record) to draw a graphic with
the colID on it. And I also want to put colN on the graphic, which colN and
colID should be matched. The loops above could match colN and colID. How
anyone know how to make it work? Thanks a lot!
Al Reid - 29 Mar 2005 13:11 GMT
> Hello,
>
[quoted text clipped - 21 lines]
> colID should be matched. The loops above could match colN and colID. How
> anyone know how to make it work? Thanks a lot!
Kate,
Why are you not just constructing a proper SQL query and returning the results of the joined tables? It would be easier and faster
to just work with to a single recordset rather than returning two recordsets and trying to externally join them. I would write a
select statement like:
SELECT J.colID, J.colN, J.colType, Q.colX, Q.colY
FROM tableJob J INNER JOIN tableQuery Q ON J.colID = Q.colID
WHERE ...
Now you are ready to work with the data.
--
Al Reid