This topic is locked

Printer-friendly page error

6/19/2007 8:53:03 AM
ASPRunnerPro General questions
K
Kman author

Hi,
When I click on the "Printer-friendly" link, I get the error "Operation is not allowed when the object is closed.".
The only pattern I can seem to find is that it happens only on detail pages, but it doesn't consistantly give me the error either. Sometimes it works, sometimes it doesn't.
I'm running ASPRunner 5.0 Build 275.
Any help would be appreciate.

K
Kman author 6/19/2007

OK, I seemed to have figured it out.
In my Master table, I joined with the same table 3 times, pulling out 3 seperate fields of information so that I could display it on the _list.asp page. Apparently, this caused some kind of problem in _masterprint.asp.
The piece of offending code:
[codebox]'// IT Effort -

value=""

if len(rsm("IT Effort"))>0 then

strdata = make_db_value("IT Effort",rsm("IT Effort"),"","")

LookupSQL="SELECT "

LookupSQL=LookupSQL & "[AttributeValue]"

LookupSQL=LookupSQL & " FROM [dbo].[ProjectAttribute] WHERE [AttributeValue] = " & strdata

LookupSQL=LookupSQL & " and (" & "AttributeID = '1004'" & ")"

LogInfo(LookupSQL)

response.write(strdata)

rss.open LookupSQL,dbConnection

if not rss.eof then

value=ProcessLargeText(rss(0),"","",MODE_PRINT)

else

value=ProcessLargeText(GetData(rsm,"IT Effort", ""),"field=IT+Effort" & keylink,"",MODE_PRINT)

end if

end if

rss.close

smarty.Add "showmaster_IT_Effort",value
'// Project Sponser -

value=""

if len(rsm("Project Sponser"))>0 then

strdata = make_db_value("Project Sponser",rsm("Project Sponser"),"","")

LookupSQL="SELECT "

LookupSQL=LookupSQL & "[AttributeValue]"

LookupSQL=LookupSQL & " FROM [dbo].[ProjectAttribute] WHERE [AttributeValue] = " & strdata

LookupSQL=LookupSQL & " and (" & "AttributeID = '1001'" & ")"

LogInfo(LookupSQL)

rss.open LookupSQL,dbConnection

if not rss.eof then

value=ProcessLargeText(rss(0),"","",MODE_PRINT)

else

value=ProcessLargeText(GetData(rsm,"Project Sponser", ""),"field=Project+Sponser" & keylink,"",MODE_PRINT)

end if

end if

rss.close

smarty.Add "showmaster_Project_Sponser",value
[/codebox]
I compared this with the _print.asp page of the master table (which worked just fine, I figured the detail page should work too) and found that there was a slight difference between when rss is closed. I replaced:
[codebox] end if

end if

rss.close[/codebox]
with:
[codebox] rss.close

else

value=""

end if[/codebox]
Is it possible to get this fix added to the next build? I don't want to keep having to change it manually :P

K
Kman author 6/19/2007

One more thing I forgot to mention was that it was null entries in either "IT Effort" or "Project Sponser" that were causing the problem. The third attribute was always filled, so it didn't matter. That's why it seemed random.