Hi there,
I have one strange error, if I read recordset value once there is the expected, but when I read this value second time there is Null.
Windows Server 2003 Standart, MS SQL Express 2005
It is in default.asp (standart IIS)
Im including code here, code where is the problem is typed in bold:
<%
dim cnn,stcnn,rstemp,strstemp
select case ucase(request("chview"))
case "INFO", "CALENDAR", "CAUSE", "NEWS", "HISTORY","LINKS","CONTACT"
session("view")=request("chview")
end select
set cnn = server.createobject("ADODB.Connection")
cnn.open application("database")
query="SELECT * FROM Documents WHERE ViewText='"+session("view")+"' and IsSelectionRoot='True' ORDER BY UID desc;"
set rstemp=cnn.execute(query)
a=0
session("docid")="0"
Odkazy=""
do until rstemp.eof
odkazy=odkazy+"<a href=""default.asp?docid="+cstr(rstemp(0))+""">"+r stemp(2)+"</a><br>"
a=a+1
if a=1 then
session("docid")=cstr(rstemp(0))
end if
rstemp.movenext
loop
if a=1 then
odkazy=""
end if
rstemp.close
cnn.close
%>
'Some HTML code
<%
if session("docid")="0" then
Response.write "Not exists."
else
set cnn = server.createobject("ADODB.Connection")
cnn.open application("database")
query="SELECT * FROM Documents WHERE UID='"+session("docid")+"';"
set rstemp=cnn.execute(query)
select case ucase(rstemp(1))
case "STT"
set stcnn = server.createobject("ADODB.Connection")
stcnn.open application("database")
stquery="SELECT * FROM Statics WHERE StaticID='"+cstr(rstemp(0))+"';"
set strstemp=stcnn.execute(stquery)
'if rstemp(4)=true then
'response.write "<h1>"+strstemp(1)+"</h1>"
'end if
'here it fails:
'(your first reading is successful, but second and any other gets null)
response.write vartype(strstemp(3)) 'Responses 8 (text)
response.write vartype(strstemp(3)) 'Responses 1 (null)
strstemp.close
stcnn.close
end select
rstemp.close
cnn.close
end if
%>
Thanks you for any suggestion.
JVV