Ask a Question related to ASP Database, Design and Development.
-
Michael #1
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
-
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... -
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... -
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! -
Runtime Error 429
Trying to boot up msn messenger control, and get "runtime error 429...activex cannot create the object" and thoughts? thanks! ... -
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... -
Ray at #2
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...contents of a textbox.> Can anyway help me work out how to make the value of a parameter theEnter a Weekend Date>
> 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>Pleasename="ReportByPubClass2" value="View Report"></p></form>> <input type="text" name="t_week_end_date"></p><p><input type="submit">
> 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
-
Michael #3
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
-
Ray at #4
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...message for the below line: -> Thanks Ray
> im nearly there I hope, although I keep getting the following error>
> Microsoft OLE DB Provider for ODBC Drivers error '80040e21'
> [Microsoft][ODBC SQL Server Driver]Optional feature not implemented
>
> dbrs = byclassnoprice.Execute
Ray at Guest
-
Aaron Bertrand [MVP] #5
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
-
Michael #6
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> </P></BODY></HTML>
Michael Guest
-
Bob Barrows [MVP] #7
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
-
Michael #8
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
-
Aaron Bertrand [MVP] #9
Re: runtime error '800a01a8'
> Do I not need a command object for my stored procedure.
No.
stored procedure.> All the notes ive looked at seem to suggest I need a command object for a
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
-
Bob Barrows [MVP] #10
Re: runtime error '800a01a8'
Michael wrote:
Just to clarify: if you use my suggested technique, a Command object WILL be> 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.
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
-
Michael #11
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
-
Michael #12
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
-
Aaron Bertrand [MVP] #13
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.
ReportByPubClass2 button on the form> How do i specify that I want the query to run on the onclick of the
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
-
Bob Barrows [MVP] #14
Re: runtime error '800a01a8'
Michael wrote:
I've already shown you how to rewrite it, but:> 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.'you won't need the include file>
> <!-- #include file="adovbs.inc" --><%
'I don't understand what the following line of code is for - you don't seem>
> Dim sDate
'to do anything with sDate'Change this line:> sDate = Request.Form("ReportByPubClass2")'to this:> dim dbcn, dbrs, byclassnoprice
dim dbcn, dbrs
'remove these lines of code> Set dbcn = server.CreateObject("ADODB.Connection")
> set dbrs = server.CreateObject("ADODB.Recordset")
>
> dbcn.open Application ("connectionString")
**************************************************************************************************** **********> '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



Reply With Quote

