<% strConnString = "driver={SQL Server};server=sql7.globalgold.co.uk;uid=betterthinking;pwd=master-point;database=betterthinking" set my_Conn = Server.CreateObject("ADODB.Connection") my_Conn.Open strConnString ip_address = Request.Servervariables("REMOTE_HOST") strSQL = "select * from voters where ip_address = '" & ip_address & "' and idforumposts = " & request("idforumposts") set rs = my_Conn.Execute (strSql) If rs.eof then rs.close idforumposts = request("idforumposts") strSQL= "update forum_posts set int_votes=int_votes+1 where idforumposts=" & request("idforumposts") set rs = my_Conn.Execute (strSql) strsql ="insert into voters (idforumposts, ip_address) values('" & request("idforumposts") & "', '" & ip_address & "')" set rs = my_Conn.Execute (strSql) response.redirect("forum.asp?id_forum_topics=" & request("idforum_topic")& "&failed_vote=0") Else response.redirect("forum.asp?id_forum_topics=" & request("idforum_topic")& "&failed_vote=1") End if %>