Last post Aug 06, 2013 04:52 AM by hans_v
Aug 05, 2013 05:52 PM|Maulsquid|LINK
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?
Aug 05, 2013 05:56 PM|AidyF|LINK
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";
sql = "select from table where id = " + myar;
Aug 05, 2013 07:19 PM|hans_v|LINK
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!
Aug 05, 2013 07:53 PM|oned_gk|LINK
Aug 06, 2013 04:52 AM|hans_v|LINK
or you give null value to parameter.
No, you won't get this error when you give a null value to a parameter....