oSubRpt = oMainRpt.OpenSubreport("subreportname")
Then you should be able to access the database object associated with the subreport, in the same general way that you'd access the database object for the main report.oDb = oSubRpt.Database()
Let me know if that helps...