locked
No value given for one or more required parameters when entering one of a page RRS feed

  • Question

  • User518954331 posted

    Hi, I got the above error message when I tried to enter one of my pages. Why is this so? Are there any specific reasons why this i shappening?

    Monday, August 5, 2013 5:52 PM

Answers

  • User-1199946673 posted

    There are 2 reasons for getting this error

    1. You're using 1 or more parameters in your query, but you don't specify one or more of them in the parameter collection. Tgis is exactly what the error is telling. Note that when you're using questionmarks as parameter(s), each and every questionmark is a different parameter, although in the logic, you know that two (or more) are the same parameter

    2. As also said by the previous poster, Access will thread any identifer it doesn't recognize as a parameter. So if you've mispellde a fieldname, Access will thread it as a parameter, which off course you didn't specify in the parameter collection. So you need to check the syntax of the query.

    If this doesn't solve your problem, please show us your code because the ASP.NET crystal ball isn't working today!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, August 5, 2013 7:19 PM

All replies

  • User-760709272 posted

    Access gives you that when you reference "something" that doesn't exist, it assumes that "something" is a variable.  If you do

    select id, name from table where value=5

    and there is no "value" field in "table" then you get that error.  It's likely you have data in a variable and are doing this;

    int myvar = 5;

    sql = "select from table where id=myvar";

    rather than

    sql = "select from table where id = " + myar;

    Monday, August 5, 2013 5:56 PM
  • User-1199946673 posted

    There are 2 reasons for getting this error

    1. You're using 1 or more parameters in your query, but you don't specify one or more of them in the parameter collection. Tgis is exactly what the error is telling. Note that when you're using questionmarks as parameter(s), each and every questionmark is a different parameter, although in the logic, you know that two (or more) are the same parameter

    2. As also said by the previous poster, Access will thread any identifer it doesn't recognize as a parameter. So if you've mispellde a fieldname, Access will thread it as a parameter, which off course you didn't specify in the parameter collection. So you need to check the syntax of the query.

    If this doesn't solve your problem, please show us your code because the ASP.NET crystal ball isn't working today!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, August 5, 2013 7:19 PM
  • User-1716253493 posted
    Usually because you don't give a value to parameter that need a value, or you give null value to parameter.
    Monday, August 5, 2013 7:53 PM
  • User-1199946673 posted

    oned_gk

    or you give null value to parameter.

    No, you won't get this error when you give a null value to a parameter....

    Tuesday, August 6, 2013 4:52 AM