Results 1 to 3 of 3

Thread: [2005] Parameterized query is not working

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2006
    Location
    Upstate NY
    Posts
    37

    [2005] Parameterized query is not working

    Using the Data Adapter configuration wizard, I am trying to create a query like following parameterized query:

    SELECT tbl.* from tbl
    WHERE (ID = @param1).
    I have set the parameter prefix to '@'.

    I am getting the following warning:

    The wizard detected the following problems when configuring the adapter "OleDbDataAdapter1":
    Details: Generate SELECT Statement
    Error in WHERE clause near '@'.
    Unable to parse query text.



    When I try to use "OleDbDataAdapter1.SelectCommand.Parameters("@param1").value = ... "

    I get the following error:

    An OleDbParameter with ParameterName '@param1' is not contained by this OldDbParameter.Collection.

    I am new to VB2005. How do I get a parameterized query to work? Your help is greatly appreciated.
    Last edited by KShum; Jan 8th, 2007 at 09:37 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width