Make sure your XPath is right. Also, if you get an object expected error, maybe that means that there were no rows that matched your criteria in the database, which tells you what you need to know.
What exactly is your error and could you give us the code snippet that is performing your query?
---------------
Matt Faus
InfoPath Dev Texas
Matt Faus / Microsoft InfoPath MVPQdabra® Software / Streamline data gathering to turn process into knowledge