Author |
Topic |
|
hollowman
Starting Member
Denmark
38 Posts |
Posted - 16 February 2004 : 11:21:08
|
Hi Problem whit Inactive Users i have a member that havent been activ for 24 days but when i wright lets say 20 days and submit he doesent pop up why?? i have to wright 5 days then him and another user pops up why do ther have to be 2 members in the list before hi pops up?? plzz help |
Hollowman. |
|
NorwegianViking
Junior Member
Denmark
119 Posts |
|
NorwegianViking
Junior Member
Denmark
119 Posts |
Posted - 16 February 2004 : 11:58:48
|
I have so far looked at this in Admin_inactive_users.asp - the date used in the query based on the input field - the SQL statement - the check for if any records is selected
The two first is fine, the latter is wrong. Running the Query in Access returns the right number of records, even if there only is one in the selection.
The author uses this statement to check if the selection is empty aDataerr = 0 if ubound(aData, 2) = 0 then aDataerr = 1 end if Later aDataerr is used to inform that there is no records. If there is 0 or 1 records selected, aDataerr is set to 1, later resulting that no records is shown.
I do not know ASP, so this is as far I can help you.
Is there anyone who can tell whats wrong with the above test?
|
kind regards NorwegianViking
Mod installation for beginners | User registration problems?
|
|
|
miperez
Junior Member
Spain
243 Posts |
Posted - 16 February 2004 : 12:23:36
|
I know what the problem can be.
Ubound returns the upper bound of the array, that usually starts in 0. So, if the array is empty, it returns 0, and if there is only one element, it also returns 0.
Try making these changes in the code (I haven't got the MOD installed, so I cannot check it myself):
set oRs = server.createobject("ADODB.Recordset")
oRs.open strSql, My_Conn
aDataerr = 0
if oRs.Recordcount = 0 then
aDataerr = 1
end if
aData = oRs.GetRows
oRs.close
set oRs = nothing
'load up our array with all the data from the query and disconnect from the record set.
aDataerr = 0
if ubound(aData, 2) = 0 then
aDataerr = 1
end if
|
Best Regards
Mikel Perez
"Hell is the place where everything test perfectly, and nothing works"
|
|
|
hollowman
Starting Member
Denmark
38 Posts |
Posted - 17 February 2004 : 01:16:40
|
Hi miperez Nice it works thanks but its the 17th today i tryed to insert 1 day and i see all but one he was on yesterday the 16th but its ok i can live with that so ones again thanks |
Hollowman. |
|
|
miperez
Junior Member
Spain
243 Posts |
Posted - 17 February 2004 : 03:56:46
|
Hi, hollowman, I'm glad it worked.
The problem with that record is that this MOD doesn't only check for days, but it also considers the time of the day, down to the level of seconds.
That is, if you ask on February 17th at 9:50 for users that have not been active for 1 day, it won't show a user that posted something on February 16th at 22:48, for instance, as he in fact sent something less than 24 hours before. |
Best Regards
Mikel Perez
"Hell is the place where everything test perfectly, and nothing works"
|
|
|
NorwegianViking
Junior Member
Denmark
119 Posts |
|
hollowman
Starting Member
Denmark
38 Posts |
Posted - 18 February 2004 : 05:50:19
|
Ahh ok Thanks again miperez |
Hollowman. |
|
|
|
Topic |
|