We help IT Professionals succeed at work.

Getting data from SQL Server via Access 2007 using dbSQLPassThrough

Last Modified: 2012-06-27
I have an application that uses MS Access as the front-end and SQL Server on the back end. In all previous versions of Access, I've used the method 'dbSQLPassThrough' and it works great (and is very fast). With Access 2007 on the front-end, I get the error 3276: Invalid database object reference. What changed in Access 2007 that this no longer works? and, more importantly, what works now?
'Note: strDataPath is set by now and has been verified as a valid path to SQL Server
Set db = DBEngine.Workspaces(0).OpenDatabase("", False, False, strDataPath)
'The name of the stored proceedure is car_DocData. It takes one argument: DocID
SQL = "car_DocData " & DocID
Set rst = db.OpenRecordset(SQL, dbOpenSnapshot, dbSQLPassThrough)
'Then I read the results of the recordset.

Open in new window

Watch Question

This one is on us!
(Get your first solution completely free - no credit card required)


Thanks again. For some reason, this question won't close! (I'm probably doing it wrong).
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.