Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I have created and saved a named query in an Access 2010 database with one parameter. However I cannot seem to be able to use it via VB.NET OleDb.

Here's the code I'm using (disregard the connection, which is set up correctly - it works using non-stored procedures)

Dim Command As New OleDb.OleDbCommand
Dim Reader As OleDb.OleDbDataReader
Command.CommandText = "SelectUser"
Command.Parameters.AddWithValue("@UserId", "1234131")
Command.CommandType = CommandType.StoredProcedure
Reader = Command.ExecuteReader

This is the code of the stored procedure in Access 2010:

SELECT Users.*
FROM Users
WHERE Users.User_Id=[@UserId];

When executing the .NET code, I'm getting the following exception: The Microsoft Access database engine cannot find the input table or query 'SelectUser'. Make sure it exists and that its name is spelled correctly.

What am I doing wrong, to me this make no sense.

share

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.