Access 2007 SQL Pass Through Queries

R

Rob

I have an Access 2003 mdb that I use to connect to a SQL 2005
database. When I open the application in Access 2007 it errors on
using SQL pass through queries.

I see that pass through queries (amongst other options) have been
disabled under Access 2007. However it seems that they are enabled
under certain circumstances so I've been trying to get them working by
changing the security settings.

The queries are still failing after setting the following:
- Sandbox Mode to 0 (turn off sandbox mode for all apps)
- Applied a recognised Digital Signature
- Trusted the Publisher
- Trusted the location of the mdb
- Enable all macros in Macro Settings

I'm using DAO to connect to the database and the code that fails
reads:
strWork = "EXECUTE spLogin"
Set rsSysUsers = dbTest.OpenRecordset(strWork, dbOpenSnapshot,
dbSQLPassThrough)

The error returned is:
error no: 3276
error description: Invalid database object reference.

Any help or ideas would be greatly appreciated.
 
S

Sylvain Lafontaine

I don't have Office 2007 installed but here's a wild guess: did you create
dbTest using the standard JET workspace or an ODBCDirect workspace?

If you don't find the source of your problem, then maybe using an ordinary
querydef for running your passthrough queries might be the solution;
however, as you don't say nothing about the rest of your code or why you are
using the dbTest object, it's hard to tell you anything more about this.
 
I

IRS Intern

uh.. DAO and Passthrus are obsolete

move to SQL Server and Access Data Projects, kids
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top