Function using vbscript 
Author Message
 Function using vbscript

Hi!

Any ideas where I am going wrong with this function?
I getting the following error:

Microsoft VBScript runtime error '800a01a8'

Object required

/BrowseCustomersList.asp, line 169

I basically want the image file to be displayed when the function is called
and upon invoking the image the below listed variables are passed to the
called asp page.

Chuck

 Function MyHistory()
  'Retrieve CO Web Settings
  'Declare all local variables
  dim conn, rs, strsql, strconn
  'Set local variable to the connection string and open the connection
  strconn = Application("stw_ConnectionString")
  set conn = server.createobject("adodb.connection")
  conn.open strconn
  'Set local recordset variable equal to rs
  set rs = server.createobject("adodb.recordset")
  'Sets the sql query that determine what records get brought back to the
asp page.
  'This could easily be change to a very specific set of fields or instead
of using a ORDER BY statement
  'Using a  WHERE statement to determine what records get selected
  strsql = "SELECT TOP 1 * FROM dbo.WebCOSettings"
  rs.open strsql, conn
   %>
 <FORM METHOD=POST ACTION="calllist.asp">
   <INPUT TYPE="HIDDEN" NAME="p"
VALUE="<%=CSTR(TRIM(RS.Fields("Password").Value))%>">
   <INPUT TYPE="HIDDEN" NAME="d"
VALUE="<%=CSTR(TRIM(RS.Fields("DealerNo").Value))%>">
   <INPUT TYPE="HIDDEN" NAME="a"
VALUE="<%=CSTR(TRIM(oRSWebCustomers.Fields("CSN").Value)))%>"><br/>
   MyHistory = <INPUT TYPE="IMAGE" src="/editpencil.gif" alt="Call List">
  </FORM>
  <%
  rs.close()
  set rs = nothing
  conn.close()
  set conn = nothing
  End Function



Wed, 04 Jan 2006 04:48:11 GMT  
 Function using vbscript
What is line 169?

Ray at work


Quote:
> I getting the following error:

> Microsoft VBScript runtime error '800a01a8'

> Object required

> /BrowseCustomersList.asp, line 169

<trimmed>


Wed, 04 Jan 2006 05:46:59 GMT  
 Function using vbscript
Hi!

This is line 169.

   <INPUT TYPE="HIDDEN" NAME="p"
VALUE="<%=CSTR(TRIM(RS3.Fields("Password").Value))%>">

Chuck



Quote:
> What is line 169?

> Ray at work



> > I getting the following error:

> > Microsoft VBScript runtime error '800a01a8'

> > Object required

> > /BrowseCustomersList.asp, line 169

> <trimmed>



Wed, 04 Jan 2006 06:00:20 GMT  
 Function using vbscript
The problem then is that you have RS3 instead of RS in your code.  Here are
a few tips:

1.  Post in the microsoft.public.inetserver.asp.general newsgroup - much
more active!
2.  At the top of ALL of your ASP pages, put this:
<% Option Explicit %>
    That will force you to declare all your variables (Dim varName), and if
you mistype a variable name like you did here, you will quickly get an error
that points that out, because your mistyped variable will be undeclared.
Option Explicit is a highly recommended habit to get in to.
3.  Don't use "SELECT *."
4.  When you're returning a recordset that you just need to grab data from,
don't do a "createobject("adodb.recordset")."  Just use code like this:

Dim rs, conn, sSQL
Dim sPassword, sDealerNo, sCSN
sSQL = "SELECT TOP 1 [Password],[DealerNo],[CSN] FROM dbo.WebCOSettings"
''no order by?  Just one record I hope then
Set conn = Server.CreateObject("ADODB.Connection")
Set rs = conn.Execute(sSQL)
If Not rs.EOF Then
    sPassword = rs.Fields(0).Value
    sDealerNo = rs.Fields(1).Value
    sCSN = rs.Fields(2).Value
End If
rs.Close
Set rs = Nothing
conn.Close
Set conn = Nothing

<FORM METHOD=POST ACTION="calllist.asp">
   <INPUT TYPE="HIDDEN" NAME="p" VALUE="<%=sPassword%>">
   <INPUT TYPE="HIDDEN" NAME="d" VALUE="<%=sDealerNo%>">
   <INPUT TYPE="HIDDEN" NAME="a" VALUE="<%=sCSN%>"><br />
   MyHistory = <INPUT TYPE="IMAGE" src="/editpencil.gif" alt="Call List">
</FORM>

------------------------------
Basically, get in, get your data, and get out as fast as you can, as a
general rule.  Even when you have to loop through a multi-record recordset,
you can get in, use GetRows(), and close your rs and disconnect right away -
but that's for another day.

Also, use <br /> as opposed to <br/>.  (Space before /)  (This is what I
heard from a particular person with reliable answers.  There are apparently
some older browsers that will not recognize the tag as being closed if you
do not precede the / with a space.)

A few links for you:

http://www.aspfaq.com/2191
http://www.aspfaq.com/2096
http://www.aspfaq.com/2424

Ray at work for about ten more seconds


Quote:
> Hi!

> This is line 169.

>    <INPUT TYPE="HIDDEN" NAME="p"
> VALUE="<%=CSTR(TRIM(RS3.Fields("Password").Value))%>">

> Chuck



> > What is line 169?

> > Ray at work



> > > I getting the following error:

> > > Microsoft VBScript runtime error '800a01a8'

> > > Object required

> > > /BrowseCustomersList.asp, line 169

> > <trimmed>



Wed, 04 Jan 2006 06:16:20 GMT  
 Function using vbscript

Quote:

> <FORM METHOD=POST ACTION="calllist.asp">
>    <INPUT TYPE="HIDDEN" NAME="p" VALUE="<%=sPassword%>">
>    <INPUT TYPE="HIDDEN" NAME="d" VALUE="<%=sDealerNo%>">
>    <INPUT TYPE="HIDDEN" NAME="a" VALUE="<%=sCSN%>"><br />
>    MyHistory = <INPUT TYPE="IMAGE" src="/editpencil.gif" alt="Call List">
> </FORM>

> Also, use <br /> as opposed to <br/>.  (Space before /)  (This is what I
> heard from a particular person with reliable answers.  There are apparently
> some older browsers that will not recognize the tag as being closed if you
> do not precede the / with a space.)

In this case, there's no need to use either form. This fragment is obviously
*not* XHTML (uppercase tag names, attributes, etc.) so just use the HTML <BR>.

--
Steve

We would often be ashamed of our finest actions if the world understood all the
motives which produced them. -Duc de La Rochefoucauld



Wed, 04 Jan 2006 19:02:31 GMT  
 Function using vbscript
I would love to get the full story on <br> vs. <BR> vs. <br /> vs. <BR />,
etc....  Come on Google!

Ray at home

--
Will trade ASP help for SQL Server help


Quote:

> > <FORM METHOD=POST ACTION="calllist.asp">
> >    <INPUT TYPE="HIDDEN" NAME="p" VALUE="<%=sPassword%>">
> >    <INPUT TYPE="HIDDEN" NAME="d" VALUE="<%=sDealerNo%>">
> >    <INPUT TYPE="HIDDEN" NAME="a" VALUE="<%=sCSN%>"><br />
> >    MyHistory = <INPUT TYPE="IMAGE" src="/editpencil.gif" alt="Call
List">
> > </FORM>

> > Also, use <br /> as opposed to <br/>.  (Space before /)  (This is what I
> > heard from a particular person with reliable answers.  There are
apparently
> > some older browsers that will not recognize the tag as being closed if
you
> > do not precede the / with a space.)

> In this case, there's no need to use either form. This fragment is
obviously
> *not* XHTML (uppercase tag names, attributes, etc.) so just use the HTML
<BR>.

> --
> Steve

> We would often be ashamed of our finest actions if the world understood
all the
> motives which produced them. -Duc de La Rochefoucauld



Thu, 05 Jan 2006 05:55:05 GMT  
 Function using vbscript
Personally, I would use <br> at the moment, until XHTML comes into it's own.
Then I would use <br />, with a space before the /.

Peter.



Quote:
> I would love to get the full story on <br> vs. <BR> vs. <br /> vs. <BR />,
> etc....  Come on Google!

> Ray at home

> --
> Will trade ASP help for SQL Server help




> > > <FORM METHOD=POST ACTION="calllist.asp">
> > >    <INPUT TYPE="HIDDEN" NAME="p" VALUE="<%=sPassword%>">
> > >    <INPUT TYPE="HIDDEN" NAME="d" VALUE="<%=sDealerNo%>">
> > >    <INPUT TYPE="HIDDEN" NAME="a" VALUE="<%=sCSN%>"><br />
> > >    MyHistory = <INPUT TYPE="IMAGE" src="/editpencil.gif" alt="Call
> List">
> > > </FORM>

> > > Also, use <br /> as opposed to <br/>.  (Space before /)  (This is what
I
> > > heard from a particular person with reliable answers.  There are
> apparently
> > > some older browsers that will not recognize the tag as being closed if
> you
> > > do not precede the / with a space.)

> > In this case, there's no need to use either form. This fragment is
> obviously
> > *not* XHTML (uppercase tag names, attributes, etc.) so just use the HTML
> <BR>.

> > --
> > Steve

> > We would often be ashamed of our finest actions if the world understood
> all the
> > motives which produced them. -Duc de La Rochefoucauld



Thu, 05 Jan 2006 06:29:36 GMT  
 Function using vbscript

Quote:

> I would love to get the full story on <br> vs. <BR> vs. <br /> vs. <BR />,
> etc....  Come on Google!

XHTML is the next-generation of HTML. XHTML 1.0 is just HTML 4.01 cast as
well-formed XML. Tag and attribute names are no longer case-insensitive; all
attributes must have a value and that value must be quoted; and most
importantly, every opening tag must be closed. This includes empty elements such
as img and br.

As XHTML, empty elements can be coded as either, e.g., <br></br> or simply
<br/>. However, older HTML-only clients might have trouble with either syntax.
Although they should ignore </br> as an unknown tag, they might assume it's a
second br element. Or they might consider <br/> to be an unknown tag and ignore
it. The format <br /> (with the space) is valid XHTML syntax and should be
understood by older clients as a br element with some strange (and ignored)
attribute.

Section C of /XHTML? 1.0 The Extensible HyperText Markup Language/, "HTML
Compatibility Guidelines", <URL:http://www.w3.org/TR/xhtml1/#guidelines>,
explains how to code XHTML that is understandable to older clients.

The W3C has published a working draft for XHTML? 2.0
<URL:http://www.w3.org/TR/xhtml2>. If you want a leg up on the new technology,
you can start coding XHTML 1.0 now, using the compatibility guidelines to ensure
that HTML 4.0-aware clients can handle it. Note that it might not be possible to
code strict XHTML 1.0 that can be understood by pre-HTML 4.0 clients (e.g.
Netscape 4.x) in all cases, but you should be able to use transitional XHTML
1.0.

--
Steve

The refusal to choose is a form of choice; disbelief is a form of belief.
-Frank Barron



Thu, 05 Jan 2006 20:00:00 GMT  
 Function using vbscript
Thanks a lot Steve.

Ray at home

--
Will trade ASP help for SQL Server help


Quote:

> > I would love to get the full story on <br> vs. <BR> vs. <br /> vs. <BR
/>,
> > etc....  Come on Google!

> XHTML is the next-generation of HTML. XHTML 1.0 is just HTML 4.01 cast as
> well-formed XML. [trimmed informative explanation]



Fri, 06 Jan 2006 12:20:49 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. directory is busy

2. Call Access Function from Outlook using VBScript

3. using vbscript to call dll function

4. Calling Win32 dlls with dos pascal

5. = Programmer's Text Editor

6. PIC programming/Interrupt trapping...

7. Detecting Windows from non-Windows program

8. Converter for coverting Mac pacal to Turbo Pasal

9. Delphi DB vs Microsoft SQL 6.0

10. Calculating Time Difference using DateDiff Function in VBScript

11. Using dll functions from VBScript

12. Using functions in other vbscript files.

 

 
Powered by phpBB® Forum Software