Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: Scripting Help

  1. #1
    New Coder
    Join Date
    Jul 2004
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Scripting Help

    Hello! I'm running the below Script and I get this error:

    Error Type:
    Microsoft VBScript runtime (0x800A0009)
    Subscript out of range: '[number: 1]'
    /t1/database/perfmgmt/newsite/manager/serviceobs/serviceObs2.asp, line 86


    Here's My Script:

    83 'Get userid of Agent from their name
    84 nameArray = split(Agent,",")
    85 First_Name = nameArray(0)
    86 last_Name = nameArray(1)
    87 query1 = "Select userid from Employees where Last_Name = '"&Last_Name&"' and First_Name = '"&First_Name&"'"
    88 set objRS=Conn.execute(query1)
    89 Agent = objRS("user_id")


    What Causes this and How can I fix it?

    Feel free to email me: Chris@thesouthside.net

  • #2
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    Sounds like your array does not have a length of 2

    Do yourself a favor and do a response.write with the array and see what it contains on the page.

    Eric
    Last edited by A1ien51; 07-09-2004 at 10:31 PM.
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

  • #3
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    Also I think the s in split should be capital, therefore it should be Split(str,"blah")

    Eric
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by A1ien51
    Also I think the s in split should be capital, therefore it should be Split(str,"blah")

    Eric
    VBScript isn't case sensitive, so he's ok on that one.
    Check out the Forum Search. It's the short path to getting great results from this forum.


  •  

    Posting Permissions

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