Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Error with string, object required

Thanks gigsvoo, I got IIS off Microsoft web site.


I have a new problem with strings.
I have written code for a recordset to be opened then to print out a field. The database part works but the printing of the string doesn't.

The error is:

Microsoft VBScript runtime error '800a01a8'

Object required: '[string: "cs 101 is worth 3 cr"]'

/asp/course_search.asp, line 62


The code is:

Set strOut = strcourse_requested & " is worth " & nhours & " credit hours."


I had this problem too when I was going to use a string for the connection information, i.e. strConn = "Provider=Micro..."

Another problem is the Option Explicit.

The error is:

Microsoft VBScript compilation error '800a0400'

Expected statement

/asp/course_search.asp, line 6

Option Explicit

The Option Explicit is the first line of code.

Also if anyone knows, what is RUNAT = "SERVER" ??

Thanks for your help,

pdunn

Comments

  • pdunnpdunn Posts: 63Member
    : I have a new problem with strings.
    : I have written code for a recordset to be opened then to print out a field. The database part works but the printing of the string doesn't.
    :
    : The error is:
    :
    : Microsoft VBScript runtime error '800a01a8'
    :
    : Object required: '[string: "cs 101 is worth 3 cr"]'
    :
    : /asp/course_search.asp, line 62
    :
    :
    : The code is:
    :
    : Set strOut = strcourse_requested & " is worth " & nhours & " credit hours."


    I found out it was the "SET" that was causing the problem.

    All the other problems I still have.
  • vanithvanith Posts: 44Member
    [b][red]This message was edited by vanith at 2002-10-8 9:32:22[/red][/b][hr]
    : Thanks gigsvoo, I got IIS off Microsoft web site.
    :
    :
    : I have a new problem with strings.
    : I have written code for a recordset to be opened then to print out a field. The database part works but the printing of the string doesn't.
    :
    : The error is:
    :
    : Microsoft VBScript runtime error '800a01a8'
    :
    : Object required: '[string: "cs 101 is worth 3 cr"]'
    :
    : /asp/course_search.asp, line 62
    :
    :
    : The code is:
    :
    : Set strOut = strcourse_requested & " is worth " & nhours & " credit hours."
    :
    :
    : I had this problem too when I was going to use a string for the connection information, i.e. strConn = "Provider=Micro..."
    :
    : Another problem is the Option Explicit.
    :
    : The error is:
    :
    : Microsoft VBScript compilation error '800a0400'
    :
    : Expected statement
    :
    : /asp/course_search.asp, line 6
    :
    : Option Explicit
    :
    : The Option Explicit is the first line of code.
    :
    : Also if anyone knows, what is RUNAT = "SERVER" ??
    :
    : Thanks for your help,
    :
    : pdunn
    :

    Hi pdunn,

    SET statement is used only to assign objects. As you have used the SET statement in your code, it expects an object on the RHS. Hence the error. For normal assignment statements use LET, which is implicit in ASP[infact, there is no Let Statement in VBscript].

    The Option Explicit statement
    Forces explicit declaration of all the variables you use in a script.

    When you use the Option Explicit statement, you must explicitly declare all variables using the Dim, Private, Public, or ReDim statements. If you attempt to use an undeclared variable name, an error occurs.

    And this must be the first line in your script, may be after the @directives (if used). I see you have your used this statement in lineno-6 of your script. Move it above to the line after your @directives, your problem is solved.


    RUNAT = "SERVER" attribute when specified in your SCRIPT tag forces your IIS to process the script before sending it to the client. This is similar to using of <% %>. This is useful when you want to use some functions in one scripting language(say JScript) different from that of your default server scripting language (say VBScript).
    If this attribute is not specified, the SCRIPT tag is sent to the client as normal HTML text and is processed by the client browser.

    :)heers,
    Vanith



Sign In or Register to comment.