1

Helllo! I'm an MS Access-beginner. After an upgrade from Access2003 to Access2010 I am changing the database connection of our MS Access-Application from ODBCDirect (not supported anymore) to ADODB.

After (hopefully) successfully establishing a DB connection over an ADODB.Connection object I am initializing an ADODB.Command object:

Dim qdfWork As ADODB.Command
...
Set qdfWork = New ADODB.Command
Set qdfWork.ActiveConnection = CurrentProject.Connection
qdfWork.CommandText = "[dbo].[storedProcedureName]"
qdfWork.CommandType = adCmdStoredProc
qdfWork.Parameters.Refresh  'HERE THE ERROR-MESSAGE OCCURS
...

There is a stored procedure with the exactly same name "[dbo].[storedProcedureName]" stored on the server, but I still get the error-message:

"the microsoft access database engine cannot find the input table or query 'dbo'. Make sure it exists and that its name is spelled correctly."

If I don't write "[dbo]" in the CommandText I still get the same message, telling that "[storedProcedureName]" can't be found.

Here is my ADODB.Connection.connectionString:

"Driver={Microsoft Access Driver (*.mdb)};Dbq=\\folder1\folder2\User1\Database.mdb; Uid=Admin;Pwd=password;"

The connection via this connectionString works fine I think, I don't get any error-messages when connecting to the DB.

I checked that CurrentProject.Connection is really the connection I need.

I don't understand why my Application can't find this stored procedure although it is stored on the server.

Thanks for reading

11
  • 1
    Have you tried removing the [dbo]. from CommandText ? Commented Jul 21, 2015 at 13:50
  • Yeah, then I get the message that "[storedProcedureName]" can't be found. Commented Jul 21, 2015 at 14:14
  • StoredProcedures in Access?? Commented Jul 21, 2015 at 14:38
  • The storedProcedures are stored on an external server and I want to use them in Access2010. Before the upgrade to Access2010 my colleagues were used to create the command object for the stored procedure this way: Dim qdfWork As QueryDef ... Set qdfWork = conWork.CreateQueryDef("", "{call dbo.storedProcedureName(?)}"). Now I've to make it work in Access2010. Therefore I'm using ADODB. I'm not experienced in Access at all..don't know what you mean by asking "SP in Access??" ...I don't know what type of server this is but my connectionString can successfully connect to it. Commented Jul 21, 2015 at 15:02
  • or at least I don't receive any Errors when connecting to the database Commented Jul 21, 2015 at 15:02

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.