Poll script

Results 1 to 3 of 3

Thread: Poll script

  1. #1
    Kate Guest

    Default Poll script

    I&#039;m trying to get this poll script to work and I keep getting an error message. I have a database table called Poll1 and another page with 2 radios buttons to vote "yes" or "no"<BR>Do I have a connection error?<BR><BR>the message error is:<BR>Error Type:<BR>ADODB.Recordset (0x800A0BB9)<BR>Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.<BR>/vote/pollget.asp, line 13<BR><BR><BR>Here&#039;s the script to pollget.asp:<BR><BR>&#060;%<BR>Radio = Request.Form("radio")<BR><BR>Dim objConn , objRS<BR><BR>set conn=Server.CreateObject("adodb.connection")<BR>co nn.open "Kids_DB"<BR>set objRS = Server.CreateObject("ADODB.Recordset")<BR><BR><BR> objRS.Open "Poll1", objConn, adOpenStatic, adLockOptimistic, adCmdTable <BR><BR>objRS(Radio).Value = objRS(Radio).Value + 1<BR>objRS.Update<BR><BR><BR>objRS.Close<BR>objCon n.Close<BR>Set objRS = Nothing<BR>Set objConn = Nothing<BR>Response.Redirect "pollres.asp"<BR>%&#062;<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Poll script

    it sounds like yuo dont have an odbc datasource set up called<BR>"Kids_db" - go to the control panel and check if its there<BR>also it should be set up as a system dsn - if it is set up as a user dsn then it will be user sensitive - ie you will need to be logged on as the person who set it up - if this is the case then just sety another one up as a system dsn.<BR><BR>

  3. #3
    Join Date
    Dec 1969

    Default RE: Poll script

    Hello Kate,<BR><BR>I spotted something which might help,<BR><BR>You declared a variable called objConn to hold your connection object, however you then have the line<BR><BR>set conn = server.createobject("ADODB.Connection")<BR><BR>thi s would be fine if you continued to use conn every time but you then went back to objConn.<BR><BR>A good idea is to put the line &#060;%Option Explicit%&#062; at the top of your page. This prevents you from using variables without declaring them with a Dim statement.<BR><BR>Good luck

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts