Author |
Topic |
|
h1dd3n
New Member
92 Posts |
Posted - 13 January 2005 : 13:32:41
|
Hi, I currently have this code that will display the online users as a list, unfortunately it does not seem to work and instead gives me an error; below i have provided the code and also the error - can anyone see any obvious mistakes in the coding by any chance that I may have missed out on? From what I can see it does not add anything into the database thus causing the error.(looked into database and no new records have appeared)
quote: <% function mySqlDate(myDate)
mySqlDate = Year(myDate) & "-" & Month(myDate) & "-" & Day(myDate) & " " & Hour(myDate) & ":" & Minute(myDate) & ":" & Second(myDate)
end function %> <% set adoCon = Server.CreateObject("ADODB.Connection") adoCon.Open MM_db_sweda1825_STRING onlinedate = mySqlDate(now())
OnlineUserIp = Request.ServerVariables("REMOTE_ADDR") strUserStatus = rs_memberstat.Fields.Item("MEMBER_STATUS").Value strUserIcon = rs_memberstat.Fields.Item("MEMBER_ICON").Value
'Set timeout in minutes strTimeout = 1 StrOnlineTimedout = dateadd("n",-strtimeout*3,mySqlDate(onlinedate)) strOnlineTimedout = mySqlDate(StrOnlineTimedout)
StrSql = "Select * From general_online Where GENONLINE_USERNAME='" & strUserID & "'" Set rs1 = adoCon.Execute(strSql)
'Check if users id exists in active users database if rs1.eof then 'Add user to database because they dont exist StrSql = "INSERT INTO general_online (GENONLINE_LOGON,GENONLINE_IP,GENONLINE_LASTSEEN,GENONLINE_USERNAME,GENONLINE_STATUS,GENONLINE_ROOM,GENONLINE_IMG) " &_ "VALUES ('" & onlinedate & "','" & OnlineUserIp & "','" & mySqlDate(now()) & "','" & strUserID & "','" & strUserStatus & "','1','" & strUserIcon & "')" adoCon.Execute (StrSql) else 'There Still active so lets update their info StrSql = "UPDATE general_online SET GENONLINE_LASTSEEN='" & mySqlDate(now()) & "', Last_Page='" &_ request.servervariables("path_info") & "' WHERE GENONLINE_USERNAME='" & strUserID & "'" adoCon.execute (StrSql) end if
'Remove Users Who Have Timed Out StrSql = "DELETE FROM general_online WHERE GENONLINE_LASTSEEN < " & StrOnlineTimedout & "" 'adoCon.execute (StrSql)
%>
quote: ADODB.Field error '800a0bcd'
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
members/mem_online.asp, line 101
|
Edited by - h1dd3n on 16 January 2005 18:29:08 |
|
DarkDrift
Junior Member
USA
126 Posts |
Posted - 13 January 2005 : 17:44:08
|
Check your DB that error is saying that there are No Records to your SELECT. If you have info in your DB i would check the code to make sure that the Table Names are Correct. Plus if your users are using this you may want to add. this error can also come from updating nothing!
If rs.BOF or rs.EOF then
Response.Write("No Active users")
else
YOUR CODE
end if
|
http://www.xcalliber.com - The Future of Boards |
Edited by - DarkDrift on 13 January 2005 17:44:44 |
|
|
h1dd3n
New Member
92 Posts |
Posted - 14 January 2005 : 05:55:03
|
it doesnt seem to add anything into the database it seems, I login and it doesnt show any active users in the database. Ive checked the database table names but to no avail. Im thinking theres a code error that prevents the INSERT command. |
|
|
h1dd3n
New Member
92 Posts |
Posted - 18 January 2005 : 14:51:54
|
anyone got any advances on this? |
|
|
Doug G
Support Moderator
USA
6493 Posts |
Posted - 18 January 2005 : 23:24:16
|
Do you have any On Error Resume Next statements in your page code that might be hiding and error message?
|
====== Doug G ====== Computer history and help at www.dougscode.com |
|
|
h1dd3n
New Member
92 Posts |
Posted - 19 January 2005 : 11:29:16
|
err no i dont it seems. i may need to ad one from the looks of it: where would I put it so it'll parse the whole page?
|
|
|
Doug G
Support Moderator
USA
6493 Posts |
Posted - 19 January 2005 : 21:17:21
|
On Error Resume Next does error trapping. You don't want any such statements while you're debugging your code.
|
====== Doug G ====== Computer history and help at www.dougscode.com |
|
|
h1dd3n
New Member
92 Posts |
Posted - 20 January 2005 : 10:54:52
|
oh...
jeese! this is pi**ing me off! i haveno idea whats causing this and its sloly turning me into dispair! |
|
|
Podge
Support Moderator
Ireland
3775 Posts |
|
h1dd3n
New Member
92 Posts |
Posted - 20 January 2005 : 15:01:18
|
sorry, didnt copy above the page. its already assigned but at the very top of the page.
<% Dim strUserID strUserID = Session("sess_username") %> |
|
|
|
Topic |
|