<%@LANGUAGE="VBSCRIPT"%> <% 'Option Explicit%> <% On ERROR Resume NEXT 'Dim Conn,count,topicid 'Dim detail,name,email,action,errmsg,marks,replyid,countreply 'Dim RS,Sql 'Marks="*" topicid=trim(request("topicid")) action= trim(request("action")) 'if action="" then ' action="form" 'end if if action="submit" then detail=trim(request("detail")) name=trim(request("name")) email=trim(request("email")) ' if errmsg="" then 'Set Conn=Server.CreateObject("ADODB.Connection") 'Conn.Open "DSN=ecommerc-thai" 'Conn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("webboard.mdb")) 'Conn.Open "DSN=webboardbkj" 'Conn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("webboard.mdb")) 'conn.open "Driver={SQL Server};Server=216.157.145.67;Database=thaiart_web;UID=thaiart_webdb;PWD=Thai_web2;" 'Sql="Select * from reply order by replyid desc " 'Set RS =Server.CreateObject("ADODB.Recordset") 'RS.Open Sql,Conn,3,3 Set Conn=Server.CreateObject("ADODB.Connection") Conn.Open "DSN=ecommerc-thai" Conn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("webboard.mdb")) 'response.End() Sql="Select * from reply order by replyid desc" Set RS =Server.CreateObject("ADODB.Recordset") RS.Open Sql,Conn,1,3 if RS.Recordcount=0 then replyid=0 else replyid=RS("replyid") end if query = "INSERT INTO reply (replyid,topicid,detail,name,email,postdatetime) VALUES('"&replyid+1&"','"&topicid&"','"&detail&"','"&name&"','"&email&"','"&now&"')" set rows= server.createobject("adodb.recordset") rows.open query,Conn,1,3 'response.Write(Sql) 'Set RS = Server.CreateObject("ADODB.Recordset") 'RS.Open Sql,Conn,1,3 'RS.AddNew 'RS("replyid")=replyid+1 'RS("topicid")=topicid 'RS("detail")=detail 'RS("name")=name 'RS("postdatetime")=now 'RS("email")=email 'RS.Update 'RS.Close end if 'dim RSGet,sSql 'Set Conn=Server.CreateObject("ADODB.Connection") 'Conn.Open "DSN=ecommerc-thai" 'Conn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("webboard.mdb")) 'response.End() 'Sql="Select * from topic where topicid=" & topicid 'Set RSGet =Server.CreateObject("ADODB.Recordset") 'RSGet.Open Sql,Conn,1,3 'Set Conn=Server.CreateObject("ADODB.Connection") 'Set RSGet=Server.CreateObject("ADODB.Recordset") 'Conn.Open "DSN=webboardbkj" 'Conn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("webboard.mdb")) 'conn.open "Driver={SQL Server};Server=216.157.145.67;Database=thaiart_web;UID=thaiart_webdb;PWD=Thai_web2;" 'sSql="Select * from topic where topicid=" & topicid ' RSGet.Open sSql,Conn,3,3 ' if not RSGet.eof then ' countreply=RSGet("reply") ' end if 'sSql="update topic set reply="&countreply+1 & " where topicid=" & topicid 'Set RSGet=Server.CreateObject("ADODB.Recordset") 'On error resume next ' RSGet=Conn.Execute(sSql) ' end if 'end if count=1 Set Conn=Server.CreateObject("ADODB.Connection") Conn.Open "DSN=ecommerc-thai" Conn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("webboard.mdb")) Sql="Select * from topic where topicid = "&request("topicid") Set RS =Server.CreateObject("ADODB.Recordset") RS.Open Sql,Conn,1,3 %> www.thaiarthritis.org

<%if not RS.eof then%>
 หัวข้อ - <%= RS("title") %> 
<%= replace(RS("detail"),chr(13),"
") %>
โดย : <%= RS("name") %> (><%=RS("email")%>) <%=day(RS("postdatetime")) & " " & ThaimonthNameIndex(month(RS("postdatetime")),true) & " " & right(year(RS("postdatetime"))+543,2)%>   [<%= formatdatetime(RS("postdatetime"),3) %>]  
<%End if 'Set Conn=Server.CreateObject("ADODB.Connection") 'Conn.Open "DSN=webboardbkj" 'Conn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("webboard.mdb")) 'conn.open "Driver={SQL Server};Server=216.157.145.67;Database=thaiart_web;UID=thaiart_webdb;PWD=Thai_web2;" 'Sql="Select * from reply where topicid="&topicid &" order by replyid " 'Set RS =Server.CreateObject("ADODB.Recordset") 'RS.Open Sql,Conn,1,3 Set Conn=Server.CreateObject("ADODB.Connection") Conn.Open "DSN=ecommerc-thai" Conn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("webboard.mdb")) Sql="Select * from reply where topicid = "&request("topicid")&" order by replyid " Set RS =Server.CreateObject("ADODB.Recordset") RS.Open Sql,Conn,1,3 %>
<%While not RS.eof%>

คำตอบ
<%= replace(RS("detail"),chr(13),"
") %>
โดย :  <%= RS("name") %>   (><%=RS("email")%>) <%=day(RS("postdatetime")) & " " & ThaimonthNameIndex(month(RS("postdatetime")),true) & " " & right(year(RS("postdatetime"))+543,2)%>   [<%= formatdatetime(RS("postdatetime"),3) %>]  
<% RS.movenext wend %>
<%=errmsg%>
  เพิ่มคำตอบได้ที่นี่
รายละเอียด :
ชื่อ : *
อีเมล์ : หากไม่มีใส่ -