Author |
Topic |
|
tove
Starting Member
Sweden
1 Posts |
Posted - 11 March 2001 : 14:00:39
|
I got a mail from my ISP. They say that "Object aren't closed after being used" in the following documents:
forum\admin_emaillist.asp forum\custom_link.asp forum\inc_create_forum_mysql.asp forum\forum.asp forum\inc_mail.asp forum\inc_top.asp forum\inc_top_short.asp forum\link.asp forum\members.asp forum\setup_login.asp forum\topic.asp
They say the following must be put in: Set ObjectName = Nothing
I'm not familiar to ASP and can't fix this fast by myself. If this is not fixed before 17th och March, my ISP will disable my forum! Please help!
If you need the URL to my forum it is http://web.bellander.nu/itp/omedvet/forum/
Thanks!
|
|
gor
Retired Admin
Netherlands
5511 Posts |
Posted - 11 March 2001 : 16:09:24
|
That is quite a list, didn't know there were ISPs out there that checked for them. Let alone disable your forum for it. I'm going to answer your question per file...and move the topic to the BUGs forum after that so that they can be fixed in the next release.
Pierre |
|
|
gor
Retired Admin
Netherlands
5511 Posts |
Posted - 11 March 2001 : 16:11:58
|
in admin_emaillist.asp
add the blue code </table> <% rs.close set rs = nothing %> <!--#INCLUDE file="inc_footer.asp" -->
starting at line 92
Pierre |
|
|
gor
Retired Admin
Netherlands
5511 Posts |
Posted - 11 March 2001 : 16:14:25
|
in custom_link.asp
add the blue code starting at line 109: Response.Redirect "forum.asp?FORUM_ID=" & rsForumInfo("FORUM_ID") & "&CAT_ID=" & rsForumInfo("CAT_ID") & "&Forum_Title=" & ChkString(rsForumInfo("F_SUBJECT"),"urlpath") end if
rsForumInfo.close set rsForumInfo = nothing my_Conn.close set my_Conn = nothing end if %>
Pierre |
|
|
gor
Retired Admin
Netherlands
5511 Posts |
Posted - 11 March 2001 : 16:17:55
|
in inc_create_forum_mysql.asp
add the blue code at the end of the file:[ my_conn.Errors.Clear
end sub
my_Conn.close set my_Conn = nothing %>
Note: If you are using Version 3.1 SR4 without the latest security fix, you might as well just delete this file for now.
Pierre |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 11 March 2001 : 16:22:53
|
Oh well, here we go again.
firstly a few explanations, if the Object in question is a recordset, it is not nescesary to set it to nothing, it is done automatically when the connection object is set to nothing.
quote:
I got a mail from my ISP. They say that "Object aren't closed after being used" in the following documents:
forum\admin_emaillist.asp recordset - not necesary forum\custom_link.asp correct, but never used by your forum forum\inc_create_forum_mysql.asp didn't check, but not used unless creating the forum on mysql forum\forum.asp recordsets - not necesary forum\inc_mail.asp object is disposed of correctly ? forum\inc_top.asp object is closed in inc_footer.asp forum\inc_top_short.asp object is closed in inc_footer_short.asp forum\link.asp they are correct, but not extensively used in forum, fixed in latest forum\members.asp recordsets - not necesary forum\setup_login.asp they are correct, but it is only ever used on setup for SQL databases forum\topic.asp recordsets - not necesary
They say the following must be put in: Set ObjectName = Nothing
I'm not familiar to ASP and can't fix this fast by myself. If this is not fixed before 17th och March, my ISP will disable my forum! Please help!
If you need the URL to my forum it is http://web.bellander.nu/itp/omedvet/forum/
Thanks!
The fact that they say the objects opened in inc_top are not closed, would indicate they have just done a search for CreateObject in your files, and then checked the same file for a corresponding set = nothing.
All the forum pages have their DB connection opened by inc_top or inc_top_short, and then closed by it's corresponding footer. If you are using an old version of the forum, then you may have some stray connections, the points noted above were from 3.1sr4 code.
took me a while to write that one
|
|
|
gor
Retired Admin
Netherlands
5511 Posts |
Posted - 11 March 2001 : 16:23:30
|
in forum.asp starting at line 76: call NTUser() end if my_Conn.close set my_Conn = nothing end if
at line 168: rsCount.close set rsCount = nothing
at the end of the file (line 516) rsCStatus.close set rsCStatus = nothing rsFStatus.close set rsFStatus = nothing rs.close set rs = nothing rsCat.close set rsCat = nothing %>
Pierre |
|
|
gor
Retired Admin
Netherlands
5511 Posts |
Posted - 11 March 2001 : 16:27:32
|
there is nothing wrong with inc_mail.asp there is a Set objNewMail = Nothing there.
Pierre |
|
|
gor
Retired Admin
Netherlands
5511 Posts |
Posted - 11 March 2001 : 16:34:39
|
There also is nothing wrong with inc_top.asp and inc_top_short.asp The connection object opened there is closed in inc_footer.asp and/or inc_footer_short.asp
Pierre |
|
|
gor
Retired Admin
Netherlands
5511 Posts |
Posted - 11 March 2001 : 16:37:56
|
in setup_login.asp add at about line 122 </form> </font> <% my_conn.close set my_conn = nothing %> <% End IF %> <% Else %>
Pierre |
|
|
gor
Retired Admin
Netherlands
5511 Posts |
Posted - 11 March 2001 : 16:42:36
|
in members.asp add at line 122: rsCount.close set rsCount = nothing set rs = Server.CreateObject("ADODB.Recordset")
and at the end of the file: end sub rs.close set rs = nothing %>
Pierre |
|
|
gor
Retired Admin
Netherlands
5511 Posts |
Posted - 11 March 2001 : 16:48:27
|
in topic.asp line 70 end if my_Conn.close set my_Conn = nothing end if
at around line 160 maxpages = 1 end if
rsCount.close set rsCount = nothing set rs = Server.CreateObject("ADODB.Recordset")
and again at line 270 set rsCount = my_Conn.Execute(strSql2)
rsCount.close set rsCount = nothing
if not rsCount.eof then
and at the end of the file (line 755): end sub
rsCStatus.close set rsCStatus = nothing rsFStatus.close set rsFStatus = nothing rs.close set rs = nothing rsCat.close set rsCat = nothing %>
Pierre |
|
|
gor
Retired Admin
Netherlands
5511 Posts |
Posted - 11 March 2001 : 16:57:35
|
Finally link.asp Remove this code: if (strAuthType = "nt") then
set my_Conn = Server.CreateObject("ADODB.Connection") my_Conn.Open strConnString call NTauthenticate() if (ChkAccountReg() = "1") then
and at the end of that file:
Response.End end if my_Conn.close set my_Conn = nothing rsTopicInfo.close set rsTopicInfo = nothing rsForumInfo.close set rsForumInfo = nothing
%>
Pierre |
|
|
gor
Retired Admin
Netherlands
5511 Posts |
Posted - 11 March 2001 : 17:03:26
|
Well...those were the files you mentioned.
Remember two things though:
1) I didn't have time to test this...
2) Like Huw said: if they have server problems this isn't the cause. All the recordsets are being closed when the connection is closed. All the connections are closed when the page is finished loading. You might keep them happy this way...but it won't fix problems they've got.
Pierre |
|
|
RichardKinser
Snitz Forums Admin
USA
16655 Posts |
Posted - 29 January 2002 : 12:45:39
|
admin_emaillist.asp applied Gor's fix custom_link.asp this file was removed from the archive for v3.4 inc_create_forum_mysql.asp this file is an include file, the connection is closed and set to nothing in setup.asp forum.asp the first fix in Gor's post wasn't necessary since that part was removed because it is called in inc_top.asp. The second fix and third fix are already there. But for the third fix, the connection is closed and set to nothing as soon as it's not needed, not at the bottom of the page. inc_mail.asp no fix needed inc_top.asp no fix needed inc_top_short.asp no fix needed link.asp applied Gor's fix (except for closing my_Conn and setting it to nothing. That is done in inc_footer.asp. members.asp applied Gor's fix setup_login.asp applied Gor's fix topic.asp nothing to fix, was already fixed.
fixed in v3.4 |
|
|
|
Topic |
|