www.webdeveloper.com
Results 1 to 3 of 3

Thread: Microsoft VBScript runtime error '800a01a8' Object required: ''

Hybrid View

  1. #1
    Join Date
    Apr 2013
    Posts
    1

    Question Microsoft VBScript runtime error '800a01a8' Object required: ''

    I setup up a test connection to input data from a form to a mysql database. However, I received the following error:

    Microsoft VBScript runtime error '800a01a8'

    Object required: ''

    /datainputstatus.asp, line 20


    Form- http://www.middletownplanning.com/form2.html
    Processing ASP- http://www.middletownplanning.com/datainputstatus.asp

    (I've noted line 20 below with "<---- Line 20")



    <%@ Language=VBSCRIPT %>

    <html>
    <head>
    <title>ShotDev.Com Tutorial</title>
    </head>
    <body>
    <%

    Dim ConnectionString,strSQL,objExec
    ConnectionString="DRIVER={MySQL ODBC 3.51 Driver}; SERVER=planning.readyhostingmysql.com; PORT=3306;" &_
    "DATABASE=contactinfo; USER=mwackers; PASSWORD=*password*; OPTION=3;"

    strSQL = ""
    strSQL = strSQL &"INSERT INTO forminput"
    strSQL = strSQL &"(1name,2email,3comment) "
    strSQL = strSQL &"VALUES "
    strSQL = strSQL &"('"&Request.Form("1name")&"','"&Request.Form("2email")&"', '"&Request.Form("3comment")
    Set objExec = Conn.Execute(strSQL) <------ Line 20
    If Err.Number = 0 Then
    Response.write("Save completed.")
    Else
    Response.write("Error Save ["&strSQL&"] ("&Err.Description&")")
    End If
    Conn.Close()
    Set objExec = Nothing
    Set Conn = Nothing
    %>
    </body>
    </html>




    here is the form:
    <html xmlns="http://www.w3.org/1999/xhtml">

    <head>
    <title>Process the HTML form data with the POST method</title>
    </head>
    <body>
    <form method="POST" action="http://www.middletownplanning.com/datainputstatus.asp" name="form1">
    <table width="70%" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td>name:</td>
    <td colspan="2"><input type="text" name="1name" value="Michiel"></td>
    </tr>
    <tr>
    <td>email:</td>
    <td colspan="2"><input type="text" name="2email" value="email@email.net"></td>
    </tr>
    <tr>
    <td>comments:</td>
    <td colspan="2"><textarea name="3comment" cols="40" rows="5">Hello World</textarea></td>
    </tr>
    <tr>
    <td>&nbsp;</td>
    <td colspan="2"><input type="submit" name="Submit" value="Submit"></td>
    </tr>
    </table>
    </form>
    </body>
    </html>

  2. #2
    Join Date
    Sep 2011
    Posts
    59
    the line Set objExec = Conn.Execute(strSQL) <------ Line 20
    if wrong you executing insert statement, it will not return recordset, so it should be
    Conn.Execute strSQL
    you should use set only if you expect object back from database

  3. #3
    Join Date
    Jan 2008
    Location
    Florida
    Posts
    1,227
    Simple.

    The object, which is Conn, does not exist so there is no object to execute.

    It appears you may have copy/pasted parts of your code from different sources.

    Change line 20 from

    Set objExec = Conn.Execute(strSQL)

    to

    Set objExec = ConnectionString.Execute(strSQL)

    since ConnectionString is a valid object.

    gk53 is also correct about fetching a recordset when one is not required. Just ConnectionString.Execute(strSQL) would suffice.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles