runtime error '800a01a8'

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default runtime error '800a01a8'

    Can anyway help me work out how to make the value of a parameter the contents of a textbox

    objParam.Value = t_week_end_date.Tex

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

    My html form is as follow

    <form name="theForm" method="post" action="reports.asp"><%sD%><p>Please Enter a Weekend Date
    <input type="text" name="t_week_end_date"></p><p><input type="submit" name="ReportByPubClass2" value="View Report"></p></form

    The error seems to go away when I add in an actual value i

    objParam.Value = 2004/01/0

    Was also wondering the date value for my parameter in my asp code is
    adDat
    and in my SQL database the data type is smalldatetime. Is this OK
    Michael Guest

  2. Similar Questions and Discussions

    1. Runtime error!
      I use Illustrator CS with windows XP. Everytime I try to open Illustrator I get the following message: "Microsoft Visual C++ Runtime Library...
    2. C++ Runtime error Win XP
      Hi all - I am administering an Intranet on my local network . The site works fine from a number of machines however, on two machines I can browse...
    3. Runtime Error!
      I have this error to (posted in the Admin forum) does anyone know how to resolve this please - It's driving my users mad!
    4. Runtime Error 429
      Trying to boot up msn messenger control, and get "runtime error 429...activex cannot create the object" and thoughts? thanks! ...
    5. c++ runtime error
      I remember getting intermittent errors like this, with a product authored in director7 - but that had no embedded fonts. It did however use an old...
  3. #2

    Default Re: runtime error '800a01a8'

    To get values from a form on a web page when the form is submitted, you use:

    TheValue = Request.Form("TheNameFromtheNameAttributeOfTheForm FieldTag")

    i.e.

    theVal = Request.Form("t_week_end_date")


    But, if you use <form method=GET, then instead of REquest.Form("thename"),
    you'd use Request.Querystring("thename")

    Ray at work

    "Michael" <anonymous@discussions.microsoft.com> wrote in message
    news:86178016-6A80-45B3-9D84-7906A160F14F@microsoft.com...
    > Can anyway help me work out how to make the value of a parameter the
    contents of a textbox.
    >
    > objParam.Value = t_week_end_date.Text
    >
    > Microsoft VBScript runtime error '800a01a8'
    > Object required: 't_week_end_date'
    >
    > My html form is as follows
    >
    > <form name="theForm" method="post" action="reports.asp"><%sD%><p>Please
    Enter a Weekend Date
    > <input type="text" name="t_week_end_date"></p><p><input type="submit"
    name="ReportByPubClass2" value="View Report"></p></form>
    >
    > The error seems to go away when I add in an actual value in
    >
    > objParam.Value = 2004/01/04
    >
    > Was also wondering the date value for my parameter in my asp code is
    > adDate
    > and in my SQL database the data type is smalldatetime. Is this OK

    Ray at Guest

  4. #3

    Default Re: runtime error '800a01a8'

    Thanks Ray
    im nearly there I hope, although I keep getting the following error message for the below line: -

    Microsoft OLE DB Provider for ODBC Drivers error '80040e21'
    [Microsoft][ODBC SQL Server Driver]Optional feature not implemented

    dbrs = byclassnoprice.Execute
    Michael Guest

  5. #4

    Default Re: runtime error '800a01a8'

    What is byclassnoprice? What is the rest of your code? It sounds to me
    that your byclassnoprice object expects an argument for the execute method.
    (ADODB.Connection? That requires a commandText (string) as the first
    argument, and this is not optional.)

    Ray at work


    "Michael" <anonymous@discussions.microsoft.com> wrote in message
    news:0F0CD882-1A5B-4C2B-B6C2-6D1A0477A149@microsoft.com...
    > Thanks Ray
    > im nearly there I hope, although I keep getting the following error
    message for the below line: -
    >
    > Microsoft OLE DB Provider for ODBC Drivers error '80040e21'
    > [Microsoft][ODBC SQL Server Driver]Optional feature not implemented
    >
    > dbrs = byclassnoprice.Execute

    Ray at Guest

  6. #5

    Default Re: runtime error '800a01a8'

    > dbrs = byclassnoprice.Execute

    What is this?

    Did you mean

    SET dbrs = someObject.Execute(someSQLstatement)

    ?

    If you show all of the relevant code instead of one line, we might be able
    to provide more accurate help.

    --
    Aaron Bertrand
    SQL Server MVP
    [url]http://www.aspfaq.com/[/url]


    Aaron Bertrand [MVP] Guest

  7. #6

    Default Re: runtime error '800a01a8'

    Here is all of the cod
    <!-- #include file="adovbs.inc" --><

    Dim sDat
    sDate = Request.Form("ReportByPubClass2"
    dim dbcn, dbrs, byclassnopric
    Set dbcn = server.CreateObject("ADODB.Connection"
    set dbrs = server.CreateObject("ADODB.Recordset"
    Set byclassnoprice = server.CreateObject("ADODB.Command"

    dbcn.open Application ("connectionString"
    byclassnoprice.ActiveConnection = dbc
    'confirm explicitly that it is a stored procedur
    byclassnoprice.CommandType = adCmdStoredPro
    'set the name of the stored procedur
    byclassnoprice.CommandText = "ByClassPUBCLASS
    'create and append the input parameters
    Dim objPara
    Set objParam = byclassnoprice.CreateParamete
    objParam.Name = "@t_week_end_date
    objParam.Type = adDat
    objParam.Direction = adParamInpu
    objParam.Value = Request.Form("t_week_end_date"
    byclassnoprice.Parameters.Append objPara

    dbrs = byclassnoprice.Execute

    dim sHTM
    if rs.eof the
    response.write "No records were returned
    els
    Response.Write "<table border=1><tr><td>
    sHTML=rs.GetString(2,,"</td><td>",
    "</td></tr><tr><td>", "NA"
    sHTML = Left(sHTML, len(sHTML) - 8
    response.Write sHTM
    response.write "</table>
    End i
    dbrs.Close
    set dbrs = nothin
    dbcn.close
    set dbcn = nothin
    %><HTML><HEAD><META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0"></HEAD><BODY><form name="accounting" method="post" action="testing.asp"><p>Please Enter a Weekending Date
    <input type="text" name="t_week_end_date"></p><p><input type="submit" id="ReportByPubClass2" name="ReportByPubClass2" value="View Report"></p></form><P>&nbsp;</P></BODY></HTML>
    Michael Guest

  8. #7

    Default Re: runtime error '800a01a8'

    You have no output parameters so you don't need a Command object. Simply do
    this:

    sDate = CDate(Request.Form("t_week_end_date"))
    dbcn.ByClassPUBCLASS sDate, dbrs

    Bob Barrows

    Michael wrote:
    > Here is all of the code
    > <!-- #include file="adovbs.inc" --><%
    >
    > Dim sDate
    > sDate = Request.Form("ReportByPubClass2")
    > dim dbcn, dbrs, byclassnoprice
    > Set dbcn = server.CreateObject("ADODB.Connection")
    > set dbrs = server.CreateObject("ADODB.Recordset")
    > Set byclassnoprice = server.CreateObject("ADODB.Command")

    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.


    Bob Barrows [MVP] Guest

  9. #8

    Default Re: runtime error '800a01a8'

    Sorry was off at the weekend. Do I not need a command object for my stored procedure. The stored procedure needs one parameter passed to it and I would like the table of results to come back in a html table. All the notes ive looked at seem to suggest I need a command object for a stored procedure. Could you advise me further on this. Thanks very much for you help.
    Michael Guest

  10. #9

    Default Re: runtime error '800a01a8'

    > Do I not need a command object for my stored procedure.

    No.
    > All the notes ive looked at seem to suggest I need a command object for a
    stored procedure.

    Only if you need a return value or output values.

    --
    Aaron Bertrand
    SQL Server MVP
    [url]http://www.aspfaq.com/[/url]


    Aaron Bertrand [MVP] Guest

  11. #10

    Default Re: runtime error '800a01a8'

    Michael wrote:
    > Sorry was off at the weekend. Do I not need a command object for my
    > stored procedure. The stored procedure needs one parameter passed to
    > it and I would like the table of results to come back in a html
    > table. All the notes ive looked at seem to suggest I need a command
    > object for a stored procedure. Could you advise me further on this.
    > Thanks very much for you help.
    Just to clarify: if you use my suggested technique, a Command object WILL be
    created by ADO in the background. A Command object is always used to execute
    queries. The only difference is who creates it. With the technique you were
    trying, YOU were explicitly creating the Command object. With my suggestion,
    ADO will create it.

    Bob Barrows
    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.


    Bob Barrows [MVP] Guest

  12. #11

    Default Re: runtime error '800a01a8'

    Am I not returning something in terms of a html table holding the results from the stored procedure. How do i specify that I want the query to run on the onclick of the ReportByPubClass2 button on the form and how do I specify that I want the input parameter to be taken from the t_week_end_date textbox on the form. Im pretty confused. When I re-write the code as Bob suggested it doesn't seem to get me anywhere. Where is my code again:
    Im sorry to keep bugging you but im close to going nuts trying to get the code to work. If its possible to use the command object I think id like to keep it in because its the only way ive ever been taught to do it. Id try another way but then I seem to get confused with how exactly to re-write the below code

    <!-- #include file="adovbs.inc" --><

    Dim sDat
    sDate = Request.Form("ReportByPubClass2"
    dim dbcn, dbrs, byclassnopric
    Set dbcn = server.CreateObject("ADODB.Connection"
    set dbrs = server.CreateObject("ADODB.Recordset"
    Set byclassnoprice = server.CreateObject("ADODB.Command"

    dbcn.open Application ("connectionString"
    'create the command objec
    'set the connectio
    byclassnoprice.ActiveConnection = dbc
    'confirm explicitly that it is a stored procedur
    byclassnoprice.CommandType = adCmdStoredPro
    'set the name of the stored procedur
    byclassnoprice.CommandText = "ByClassPUBCLASS
    'create and append the input parameters
    Dim objPara
    Set objParam = byclassnoprice.CreateParamete
    objParam.Name = "@t_week_end_date
    objParam.Type = adDat
    objParam.Direction = adParamInpu
    objParam.Value = CDate (Request.Form("t_week_end_date")
    byclassnoprice.Parameters.Append objPara

    set dbrs = dbcn.Execute("ByClassPUBCLASS", "@t_week_end_date"

    dim sHTM
    if rs.eof the
    response.write "No records were returned
    els
    Response.Write "<table border=1><tr><td>
    sHTML=rs.GetString(2,,"</td><td>",
    "</td></tr><tr><td>", "NA"
    sHTML = Left(sHTML, len(sHTML) - 8
    response.Write sHTM
    response.write "</table>
    End i
    dbrs.Close
    set dbrs = nothin
    dbcn.close
    set dbcn = nothin

    %>
    Michael Guest

  13. #12

    Default Re: runtime error '800a01a8'

    Bob I wasn't sure were exactly to add your code and what exactly to delete out thats why i've got confused and it didn't seem to work. Here is my code again below, could you show me what exactly you mean by replacing some of my code and deleting the command object part of it. My code is as follows:
    Sorry for bugging you Im just really desperate and thanks for all your hel

    <!-- #include file="adovbs.inc" --><
    Dim sDat
    sDate = Request.Form("ReportByPubClass2"
    dim dbcn, dbrs, byclassnopric
    Set dbcn = server.CreateObject("ADODB.Connection"
    set dbrs = server.CreateObject("ADODB.Recordset"
    Set byclassnoprice = server.CreateObject("ADODB.Command"

    dbcn.open Application ("connectionString"
    'create the command objec
    'set the connectio
    byclassnoprice.ActiveConnection = dbc
    'confirm explicitly that it is a stored procedur
    byclassnoprice.CommandType = adCmdStoredPro
    'set the name of the stored procedur
    byclassnoprice.CommandText = "ByClassPUBCLASS
    'create and append the input parameters
    Dim objPara
    Set objParam = byclassnoprice.CreateParamete
    objParam.Name = "@t_week_end_date
    objParam.Type = adDat
    objParam.Direction = adParamInpu
    objParam.Value = CDate (Request.Form("t_week_end_date")
    byclassnoprice.Parameters.Append objPara

    set dbrs = dbcn.Execute("ByClassPUBCLASS", "@t_week_end_date"

    dim sHTM
    if rs.eof the
    response.write "No records were returned
    els
    Response.Write "<table border=1><tr><td>
    sHTML=rs.GetString(2,,"</td><td>",
    "</td></tr><tr><td>", "NA"
    sHTML = Left(sHTML, len(sHTML) - 8
    response.Write sHTM
    response.write "</table>
    End i
    dbrs.Close
    set dbrs = nothin
    dbcn.close
    set dbcn = nothin

    %>
    Michael Guest

  14. #13

    Default Re: runtime error '800a01a8'

    > Am I not returning something in terms of a html table holding the results
    from the stored procedure.

    That's a RESULTSET, not a RETURN VALUE or OUTPUT VARIABLE.
    > How do i specify that I want the query to run on the onclick of the
    ReportByPubClass2 button on the form

    Now you're confusing VB with ASP. ASP runs on the server and can't respond
    in real time to client-side activity, since ASP runs, returns HTML to the
    client, and that's it. You need to invoke another page to run ASP code
    based on user activity.

    --
    Aaron Bertrand
    SQL Server MVP
    [url]http://www.aspfaq.com/[/url]


    Aaron Bertrand [MVP] Guest

  15. #14

    Default Re: runtime error '800a01a8'

    Michael wrote:
    > Am I not returning something in terms of a html table holding the
    > results from the stored procedure. How do i specify that I want the
    > query to run on the onclick of the ReportByPubClass2 button on the
    > form and how do I specify that I want the input parameter to be taken
    > from the t_week_end_date textbox on the form. Im pretty confused.
    > When I re-write the code as Bob suggested it doesn't seem to get me
    > anywhere. Where is my code again: - Im sorry to keep bugging you but
    > im close to going nuts trying to get the code to work. If its
    > possible to use the command object I think id like to keep it in
    > because its the only way ive ever been taught to do it. Id try
    > another way but then I seem to get confused with how exactly to
    > re-write the below code.
    I've already shown you how to rewrite it, but:
    >
    > <!-- #include file="adovbs.inc" --><%
    'you won't need the include file
    >
    > Dim sDate
    'I don't understand what the following line of code is for - you don't seem
    'to do anything with sDate
    > sDate = Request.Form("ReportByPubClass2")
    'Change this line:
    > dim dbcn, dbrs, byclassnoprice
    'to this:
    dim dbcn, dbrs
    > Set dbcn = server.CreateObject("ADODB.Connection")
    > set dbrs = server.CreateObject("ADODB.Recordset")
    >
    > dbcn.open Application ("connectionString")
    'remove these lines of code
    **************************************************
    > 'create the command object
    > Set byclassnoprice = server.CreateObject("ADODB.Command")
    > 'set the connection
    > byclassnoprice.ActiveConnection = dbcn
    > 'confirm explicitly that it is a stored procedure
    > byclassnoprice.CommandType = adCmdStoredProc
    > 'set the name of the stored procedure
    > byclassnoprice.CommandText = "ByClassPUBCLASS"
    > 'create and append the input parameters
    > Dim objParam
    > Set objParam = byclassnoprice.CreateParameter
    > objParam.Name = "@t_week_end_date"
    > objParam.Type = adDate
    > objParam.Direction = adParamInput
    > objParam.Value = CDate (Request.Form("t_week_end_date"))
    > byclassnoprice.Parameters.Append objParam
    >
    > set dbrs = dbcn.Execute("ByClassPUBCLASS", "@t_week_end_date")
    >
    ************************************************** **********

    'use this line of code to open the recordset:
    sDate = CDate(Request.Form("t_week_end_date"))
    dbcn.ByClassPUBCLASS sDate, dbrs

    'The rest of the code stays the same

    Bob Barrows
    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.


    Bob Barrows [MVP] Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139