zuper89 Posted December 29, 2005 Share Posted December 29, 2005 What is wrong, why dosnt it work ? <%DIM objConnSet objConn = Server.CreateObject("ADODB.Connection")objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("db/timerussen.mdb") & ";"objConn.OpenmySQL = "SELECT * FROM poll"DIM objPLSet objPL = Server.CreateObject("ADODB.Recordset")objPL.Open mySQL, objConndim pollpoll=Request.Form("poll")%><form action="" method="post"><table> <tr> <td colspan="2"><% Response.Write objPL("po_sporsmal") %></td> </tr><%If objPL("po_svar1") <> "" Then%> <tr> <td><input type="radio" name="poll" <%if poll="svar1" then Response.Write("checked")%> value="po_svar1"></input> </td> <td><% Response.Write objPL("po_svar1") %></td> </tr><%End IfIf objPL("po_svar2") <> "" Then%> <tr> <td><input type="radio" name="poll" <%if poll="svar2" then Response.Write("checked")%> value="po_svar2"></input> </td> <td><% Response.Write objPL("po_svar2") %></td> </tr><%End IfIf objPL("po_svar3") <> "" Then%> <tr> <td><input type="radio" name="poll" <%if poll="svar3" then Response.Write("checked")%> value="po_svar3"></input> </td> <td><% Response.Write objPL("po_svar3") %></td> </tr><%End IfIf objPL("po_svar4") <> "" Then%> <tr> <td><input type="radio" name="poll" <%if poll="svar4" then Response.Write("checked")%> value="po_svar4"></input> </td> <td><% Response.Write objPL("po_svar4") %></td> </tr><%End IfIf objPL("po_svar5") <> "" Then%> <tr> <td><input type="radio" name="poll" <%if poll="svar5" then Response.Write("checked")%> value="po_svar5"></input> </td> <td><% Response.Write objPL("po_svar5") %></td> </tr><%End IfIf objPL("po_svar6") <> "" Then%> <tr> <td><input type="radio" name="poll" <%if poll="svar6" then Response.Write("checked")%> value="po_svar6"></input> </td> <td><% Response.Write objPL("po_svar6") %></td> </tr><%End IfIf objPL("po_svar7") <> "" Then%> <tr> <td><input type="radio" name="poll" <%if poll="svar7" then Response.Write("checked")%> value="po_svar7"></input> </td> <td><% Response.Write objPL("po_svar7") %></td> </tr><%End IfIf objPL("po_svar8") <> "" Then%> <tr> <td><input type="radio" name="poll" <%if poll="svar8" then Response.Write("checked")%> value="po_svar8"></input> </td> <td><% Response.Write objPL("po_svar8") %></td> </tr><%End If%> <tr> <td><input type="submit" value="Vote" /></td> </tr></table><%if poll<>"" then UPDATE poll SET " & poll & " = " & poll & " +1 WHERE po_id = Response.Write objPL("po_id")end ifobjPL.CloseSet objPL = NothingobjConn.CloseSet objConn = Nothing%> When I am trying to open it in explorer it says;Microsoft VBScript-kompileringsfeil error '800a0401' Forventet slutt på setning /tests/poll1.asp, line 79line 79 is; UPDATE poll SET " & poll & " = " & poll & " +1 WHERE po_id = Response.Write Link to comment Share on other sites More sharing options...
zuper89 Posted January 2, 2006 Author Share Posted January 2, 2006 People,You dont know?ordont care ? Link to comment Share on other sites More sharing options...
raviprakashg Posted January 3, 2006 Share Posted January 3, 2006 i don't know where u execute the Query. Explain me More.give me the error in english Link to comment Share on other sites More sharing options...
dhsd6061 Posted January 3, 2006 Share Posted January 3, 2006 See line 79... You need to reference your recordset and use quotations.ie:objPL.Open "UPDATE poll SET .......good luck.chris<%if poll<>"" then UPDATE poll SET " & poll & " = " & poll & " +1 WHERE po_id = Response.Write objPL("po_id")end ifobjPL.CloseSet objPL = NothingobjConn.CloseSet objConn = Nothing%>[/code]When I am trying to open it in explorer it says;Microsoft VBScript-kompileringsfeil error '800a0401' Forventet slutt på setning /tests/poll1.asp, line 79line 79 is; UPDATE poll SET " & poll & " = " & poll & " +1 WHERE po_id = Response.Write <{POST_SNAPBACK}> Link to comment Share on other sites More sharing options...
dhsd6061 Posted January 3, 2006 Share Posted January 3, 2006 See line 79... You need to reference your recordset and use quotations.ie:objPL.Open "UPDATE poll SET .......good luck.chris<%if poll<>"" then UPDATE poll SET " & poll & " = " & poll & " +1 WHERE po_id = Response.Write objPL("po_id")end ifobjPL.CloseSet objPL = NothingobjConn.CloseSet objConn = Nothing%>[/code]When I am trying to open it in explorer it says;Microsoft VBScript-kompileringsfeil error '800a0401' Forventet slutt på setning /tests/poll1.asp, line 79line 79 is; UPDATE poll SET " & poll & " = " & poll & " +1 WHERE po_id = Response.Write <{POST_SNAPBACK}> Link to comment Share on other sites More sharing options...
zuper89 Posted January 5, 2006 Author Share Posted January 5, 2006 Can anyone tell me how to update a database,I have read the sql tutorials, and dosnt get that much information, because i not sure how to connect to a database when im going to update. And i dont find any place where it is explained how to do that, so, if you now it, why dont you tell me ? Link to comment Share on other sites More sharing options...
zuper89 Posted January 7, 2006 Author Share Posted January 7, 2006 PLEASE !!Can anyone please tell me whats wrong?PLEASE !! <%DIM objConnSet objConn = Server.CreateObject("ADODB.Connection")objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("db/timerussen.mdb") & ";"objConn.OpenmySQL = "SELECT * FROM poll"DIM objPLSet objPL = Server.CreateObject("ADODB.Recordset")objPL.Open mySQL, objConndim pollpoll=Request.Form("poll")%><form action="" method="post"><table> <tr> <td colspan="2"><% Response.Write objPL("po_sporsmal") %></td> </tr><%If objPL("po_svar1") <> "" Then%> <tr> <td><input type="radio" name="poll" <%if poll="svar1" then Response.Write("checked")%> value="po_svar1"></input> </td> <td><% Response.Write objPL("po_svar1") %></td> </tr><%End IfIf objPL("po_svar2") <> "" Then%> <tr> <td><input type="radio" name="poll" <%if poll="svar2" then Response.Write("checked")%> value="po_svar2"></input> </td> <td><% Response.Write objPL("po_svar2") %></td> </tr><%End If%> <tr> <td><input type="submit" value="Vote" /></td> </tr></table><%if poll<>"" thenobjPL.UPDATE pollobjPL.SET " & poll & " = " & poll & " +1objPL.WHERE po_id = objPL("po_id")end ifobjPL.Closeset objPL = NothingobjConn.CloseSet objConn = Nothing%> PLEASE !!Can anyone please tell me whats wrong?PLEASE !! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now