% if ( Request.QueryString("LOGOUT") = "1" ) then session("USERNAME") = "" end if %> <% if( request.QueryString("ERRCODE") = "SUCCEMAIL") then msg = "Topic has been emailed successfully to your friend" end if topicid = request.QueryString("topic") if request.QueryString("flag") = "T" then set rs = server.CreateObject("ADODB.Recordset") hidtipicid = request.querystring("topic") selsql = " select * from tblTopic where TopicId=" & topicid rs.Open selsql,db,3 views = rs.fields("NoOfViews") rs.close totviews = cint(views) + 1 updsql = "update tblTopic set NoOfViews=" & totviews & " where TopicId=" & topicid db.execute(updsql) end if %> <% set rs = server.CreateObject("ADODB.Recordset") 'selsql = "select * from tblTopic where TopicId=" & request.QueryString("topic") selsql = "select tblTopic.TopicId,tblTopic.CategoryId, tblTopic.Subject, tblTopic.Message, tblTopic.Date, tblTopic.UserId, tblCategory.Name, tblCategory.CategoryId from tblTopic, tblCategory where TopicId=" & request.QueryString("topic") & " and tblTopic.CategoryId = tblCategory.CategoryId" rs.Open selsql,db,3 %>