...

View Full Version : Scripting Help



fishbone34
07-07-2004, 10:31 PM
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

A1ien51
07-07-2004, 11:00 PM
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

A1ien51
07-07-2004, 11:02 PM
Also I think the s in split should be capital, therefore it should be Split(str,"blah")

Eric

Roy Sinclair
07-09-2004, 10:10 PM
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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum