Author |
Topic |
|
ikalota
Starting Member
37 Posts |
Posted - 08 November 2004 : 15:23:11
|
Hi all,
I am getting the following error with this MOD, but it is not consistent. If I press the browser refresh button, the error goes away and the stats are displayed. But I always get the error on the exact same line. Does anyone have any idea as to Why it is happening? I am displaying Site Stats on the inc_site_left.asp. I have the Site Integration Mod installed. It was also happening when I moved the Site Stats from inc_site_left.asp to the centre of my portal page.
Here is the code that is causing error:
'We get the Total Day Visit If strTotalDayVisitor = "1" then strSql = "SELECT SITESTAT_DAY_Visitor AS Day_Visit FROM " & strMemberTablePrefix & "SITESTAT WHERE (((SITESTAT_YEAR)=" & strSS_Year & ") AND ((SITESTAT_MONTH)=" & strSS_Month & ") AND ((SITESTAT_TODAY)=" & strSS_Day & "))" set rs = my_conn.execute(strSql,adOpenStatic,adCmdTxt) DAY_Visit=rs("DAY_Visit") End If
Thanks in advance.
Microsoft JET Database Engine error '80040e10'
No value given for one or more required parameters.
/snitz/inc_sitestat.asp, line 350
[edit]moved to correct forum[/edit] |
Edited by - davemaxwell on 13 November 2004 16:51:36 |
|
laser
Advanced Member
Australia
3859 Posts |
Posted - 08 November 2004 : 16:07:44
|
A link to see this in action would be good, but I'm guessing line 350 is :
DAY_Visit=rs("DAY_Visit")
and the problem only arises when there is nothing returned in the SQL statement. To fix it, add these lines above & below my guess at line 350, to make it look like this :
If not rs.BOF and not rs.EOF then
DAY_Visit=rs("DAY_Visit")
End If
Let me know if it works. |
|
|
ikalota
Starting Member
37 Posts |
Posted - 11 November 2004 : 13:35:21
|
Hi laser,
Thanks for your help. I tried adding the code u suggested but it didn't help. Anyways, I think, I figured out the problem. The code is using mixed case i.e. the actual field/column names in the table are all Upper case and the code was using field names with mixed cases: please see below:
strSql = "SELECT SITESTAT_DAY_Visitor AS Day_Visit FROM " & strMemberTablePrefix & "SITESTAT WHERE (((SITESTAT_YEAR)=" & strSS_Year & ") AND ((SITESTAT_MONTH)=" & strSS_Month & ") AND ((SITESTAT_TODAY)=" & strSS_Day & "))" set rs = my_conn.execute(strSql,adOpenStatic,adCmdTxt) DAY_Visit=rs("DAY_Visit")
The highlighted red should have been in Upper case while the highlighted blue should have been in the lower case.
After this fix, I havent gotten this error at all. It seems like that was it and it is working fine now. I made these changes couple days ago and havent gotten any errors since whereas I was getting this error quite a few times during a day.
|
|
|
laser
Advanced Member
Australia
3859 Posts |
Posted - 11 November 2004 : 14:47:08
|
Interesting ... ASP shouldn't be case sensitive, or maybe and I always use lower-case. But I'm glad it works anyway |
|
|
ikalota
Starting Member
37 Posts |
Posted - 13 November 2004 : 01:05:11
|
Yup... I think you are right. I believe ASP is not case sensitive. BUT you know what I think MS Access is perhaps case sensitive, because the table column name being used was in mixed case.
The good thing is that the change is DEFINITELY working. I have not seen a single error since the change.
|
|
|
PeeWee.Inc
Senior Member
United Kingdom
1893 Posts |
Posted - 13 November 2004 : 06:44:21
|
If i remember right, in some cased ASP is case senitive. |
De Priofundus Calmo Ad Te Damine |
|
|
|
Topic |
|