Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Use of NextRecordSet??

Status
Not open for further replies.

robertl

Programmer
Jan 8, 2001
23
GB
I have an access 2000 database with two tables
An employee table linked to a holiday table (which
contains a field for the link and a date/time field)
The relationship is one-to-many

I have the following line in my application.
Code:
SQLString = "SELECT Count(EmployeeName.ID) AS NoOfEmp, EmployeeName.Name, EmployeeName.ID from EmployeeName GROUP BY EmployeeName.Name, EmployeeName.ID"

This is great, as I'm able to display all the names of the employees.

The next thing I'm attempting to do is then query the holiday table to display all the holidays that each employee is taking (if an employee isn't taking holidays, I
then move on to the next record using the MoveNext command).
I think the NextRecordSet will let me do this, but if I have
to go back to the first query, am I able to do so by issuing another NextRecordSet?

Any insight is appreciated. ::)



 
The NextRecordset method is used when you execute a command that will return more than one recordset from the server.
Generally you do what you need to do with each recordset and then move on via the NextRecordset metod.
As far as I know, there is no way of switching back and forth between the sets in the same way that you do with individual rows in a recordset.

I suggest that you use two separate recordsets instead, or possibly that you use datashaping to create a 2 dimensional recordset.

Good Luck
-Mats Hulten
 
I set up another recordset and read from the second rs
in order to transverse the second table. Works fine

Thanks for the idea. ::)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top