Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / Database Access / March 2005



Tip: Looking for answers? Try searching our database.

a logical question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kate - 29 Mar 2005 09:57 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.