Ok, this is probably an unbelievably simple question but for some reason I cant seem to dig up a strightforward answer:
I'm using ADO/ODBC to connect to a db (Sybase) and pull some stuff out, which I then have to reformat and put in a text file and send off somewhere else. Easy enough. The data in question is acutally some fields from 2 or 3 different tables. I grab this stuff with a simple SQL statement:
SELECT cvs.ARCHIVE_PROCEDURES.ProcIDExt, cvs.ARCHIVE_EPISODES.MRN, cvs.ARCHIVE_PROCEDURES.ProcTime, cvs.ARCHIVE_PROCEDURES.ProcCodeID, cvs.ARCHIVE_EPISODES.CancelFlag, cvs.ARCHIVE_EPISODES.CustArriveTime, cvs.ARCHIVE_PROCEDURES.CancelFlag, cvs.ARCHIVE_PROCEDURES.ExpireTime, cvs.ARCHIVE_PROCEDURES.ProcState
FROM cvs.ARCHIVE_EPISODES INNER JOIN cvs.ARCHIVE_PROCEDURES ON cvs.ARCHIVE_EPISODES.EpisodeID = cvs.ARCHIVE_PROCEDURES.EpisodeID
via an oRS.OPEN command with the above SQL included as a parameter. I then get a bunch of nice oRS!fields that I can do what I need to with.
PROBLEM: This has always worked well enough before, but now for the first time I have 2 fields that have the same name but are in 2 different tables (cvs.ARCHIVE_PROCEDURES.CancelFlag and cvs.ARCHIVE_EPISODES.CancelFlag). Using the normal syntax I could reference such a field as oRS!CancelFlag and it works fine....but now there are 2 oRS!CancelFlag fields. How do I reference them or tell the difference? Is the only way to do this to build a separate recordset for each table and then somehow cross-link that info when moving through the recordsets? Or is there some easier way?
I know this is probably ADO 101, but it's just never come up before....