Results 1 to 3 of 3

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

  1. #1
    Join Date
    Apr 2013

    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 %>

    <title>ShotDev.Com Tutorial</title>

    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.")
    Response.write("Error Save ["&strSQL&"] ("&Err.Description&")")
    End If
    Set objExec = Nothing
    Set Conn = Nothing

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

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

  2. #2
    Join Date
    Sep 2011
    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

    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)


    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