The microsoft access database engine cannot find the input table or query 'dbo'.. (VBA, Access2010)

老子叫甜甜 提交于 2020-01-05 08:46:33

问题


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

来源:https://stackoverflow.com/questions/31540879/the-microsoft-access-database-engine-cannot-find-the-input-table-or-query-dbo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!