www.webdeveloper.com
Results 1 to 2 of 2

Thread: Object Required Error

  1. #1
    Join Date
    Apr 2006
    Location
    Philippines
    Posts
    2

    Object Required Error

    Hi,

    Could somebody help me? Every time I run the script I made for an online tracker I get the error statement: Microsoft VBScript runtime (0x800A01A8); Object required. What's wrong?

    The complete syntax would be:


    <%
    Sub main(fcampaign,fshift,phoneneumber,fremarks)
    OpenConn()
    Set objCommand = CreateCmd("FAQ_CheckPhonenumbers")
    With objCommand
    .Parameters.Append .CreateParameter("@phonenumber", adVarChar, adParamInput, 25, phonenumber)
    Set RsCallData = objCommand.Execute()
    End With

    If Not RsCallData.EOF Then
    stats = "Done"
    Set objCommand = CreateCmd("FAQ_CheckPhonenumbersForDontCall")
    With objCommand
    .Parameters.Append .CreateParameter("@phonenumber", adVarChar, adParamInput, 25, phonenumber)
    Set RsCallData = objCommand.Execute()
    End With

    if RsCallData.EOF then
    Set objCommand = CreateCmd("FAQ_InsertToBadCall")
    With objCommand .Parameters.Append .CreateParameter("@phonenumber", adVarChar, adParamInput, 25, phonenumber)
    Set RSCallData = objCommand.Execute()
    End With

    Set objCommand = CreateCmd("FAQ_InsertToTracker")
    With objCommand .Parameters.Append .CreateParameter("@phoneneumber", adVarChar, adParamInput, 25, phonenumber) .Parameters.Append .CreateParameter("@campaign", adVarChar, adParamInput, 10, fcampaign) .Parameters.Append .CreateParameter("@shift", adVarChar, adParamInput, 20, fshift) .Parameters.Append .CreateParameter("@remarks", adVarChar, adParamInput, 30, fremarks) .Parameters.Append .CreateParameter("@stats", adVarChar, adParamInput, 10, stats)
    Set RsCallData = objCommand.Execute()
    End With

    Set objCommand = CreateCmd("FAQ_GetPhonenumbersByPhonenumber")
    With objCommand .Parameters.Append .CreateParameter("@phonenumber", adVarChar, adParamInput, 25, phonenumber)
    Set RsCallData = objCommand.Execute()
    End With

    campaign = RsCallData("campaign")
    shift = RsCallData("shift")
    datetime = RsCallData("datetime")
    phonenumber = RsCallData("phonenumber")
    remarks = RsCallData("remarks")
    stats = RsCallData("status")
    %>

    <table width="875" height="49" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#000099">
    <tr bgcolor="#9999FF" class="header1">
    <td width="96" height="28"><div align="center" class="Label2d">CAMPAIGN</div></td>
    <td width="156"><div align="center" class="Label2d">SHIFT</div></td>
    <td width="166"><div align="center" class="Label2d">DATE/TIME</div></td>
    <td width="175"><div align="center" class="Label2d">PHONENUMBER</div></td>
    <td width="136"><div align="center" class="Label2d">REMARKS</div></td>
    <td width="133"><div align="center">STATUS</div></td>
    </tr>
    <tr class="Label2d">
    <td width="96" height="19"><div align="center"><%=campaign%></div></td>
    <td width="156"><div align="center"><%=shift%></div></td>
    <td width="166"><div align="center"><%=datetime%></div></td>
    <td width="175"><div align="center"><%=phonenumber%></div></td>
    <td width="136"><div align="center"><%=remarks%></div></td>
    <td width="133"><div align="center"><%=stats%></div></td>
    </tr>
    </table>
    <%
    else
    %>
    <p align="center" class="Label2bold style2">The number is already in the DNC List!</p>
    <%
    end if
    else
    stats = "Pending"

    Set objCommand = CreateCmd("FAQ_InsertToTracker")
    With objCommand .Parameters.Append .CreateParameter("@phoneneumber", adVarChar, adParamInput, 25, phonenumber) .Parameters.Append .CreateParameter("@campaign", adVarChar, adParamInput, 10, fcampaign) .Parameters.Append .CreateParameter("@shift", adVarChar, adParamInput, 20, fshift) .Parameters.Append .CreateParameter("@remarks", adVarChar, adParamInput, 30, fremarks) .Parameters.Append .CreateParameter("@stats", adVarChar, adParamInput, 10, stats)

    Set RSCallData = objCommand.Execute()
    End With

    Set objCommand = CreateCmd("FAQ_GetPhonenumbersByPhonenumber")
    With objCommand .Parameters.Append .CreateParameter("@phonenumber", adVarChar, adParamInput, 25, phonenumber)
    Set RSCallData = objCommand.Execute()
    End With

    campaign = RsCallData("campaign")
    shift = RsCallData("shift")
    datetime = RsCallData("datetime")
    phonenumber = RsCallData("phonenumber")
    remarks = RsCallData("remarks")
    stats = RsCallData("status")
    %>
    <table width="875" height="49" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#000099">
    <tr bgcolor="#9999FF" class="header1">
    <td width="96" height="28"><div align="center" class="Label2d">CAMPAIGN</div></td>
    <td width="156"><div align="center" class="Label2d">SHIFT</div></td>
    <td width="166"><div align="center" class="Label2d">DATE/TIME</div></td>
    <td width="175"><div align="center" class="Label2d">PHONENUMBER</div></td>
    <td width="136"><div align="center" class="Label2d">REMARKS</div></td>
    <td width="133"><div align="center">STATUS</div></td>
    </tr>
    <tr class="Label2d">
    <td width="96" height="19"><div align="center"><%=campaign%></div></td>
    <td width="156"><div align="center"><%=shift%></div></td>
    <td width="166"><div align="center"><%=datetime%></div></td>
    <td width="175"><div align="center"><%=phonenumber%></div></td>
    <td width="136"><div align="center"><%=remarks%></div></td>
    <td width="133"><div align="center"><%=stats%></div></td>
    </tr>
    </table>
    <%
    End if
    Set RsCallData = Nothing
    Set sg_objConn =Nothing
    CloseConn()

    End Sub


    %>
    <html>

    <head>
    <link href="style.css" rel="stylesheet" type="text/css">
    <style type="text/css">
    <!--
    .style2 {color: #FF0000}
    -->
    </style>
    </head>

    <body>
    <p align="center"><img src="images/ta_logo.gif" width="45" height="51">
    </p>
    <p align="center" class="Label2bold">Online DNC Tracker</p>
    <p align="center" class="Label2bold">&nbsp;</p>

    <%
    fcampaign = Request.Form("campaign")
    fshift = Request.Form("shift")
    phonenumber = Request.Form("phonenumber")
    fremarks = Request.Form("remarks")

    If (phonenumber = "" OR fcampaign = "0" OR fshift = "0" OR fremarks = "0") Then
    %>

    <p align="center" class="Label2bold style2">Incomplete data!</p>

    <%
    Else

    Select Case fcampaign

    Case "ARC1"
    %>
    <!--#include file="includes/config.asp" -->
    <%
    main fcampaign, fshift, phoneneumber, fremarks
    Case "ARC2"
    %>
    <!--#include file="includes/config2.asp" -->
    <%
    main fcampaign, fshift, phoneneumber, fremarks
    Case "PASS"
    %>
    <!--#include file="includes/config3.asp" -->
    <%
    main fcampaign, fshift, phoneneumber, fremarks
    Case "CMS"
    %>
    <!--#include file="includes/config4.asp" -->
    <%
    main fcampaign, fshift, phoneneumber, fremarks
    Case "VANKAR"
    %>
    <!--#include file="includes/config5.asp" -->
    <%
    main fcampaign, fshift, phoneneumber, fremarks
    End Select

    End If
    %>
    <p align="center" class="Label2bold">Go to <a href="dnc_view_main.asp" class="Label2dred">View Page</a></p>
    <p align="center" class="Label2bold">&nbsp;</p>
    </body>
    </html>

    <!-- developer: Joseph Salugta -->

  2. #2
    Join Date
    Feb 2003
    Posts
    2,745
    Would need to see what's in the OpenConn and especially Create_Command methods. Where are you declaring objCommand? May be a scoping problem

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