Not as a generic function, but take a look at this utility … List objects used in a series of reports. It uses VBA, and could be modified to record the .SQL property for each data provider instead of the object class and name.
Dwayne Hoffpauir (BOB member since 2002-09-19)