dcsimg
Results 1 to 8 of 8
  1. #1

    Thread Starter
    New Member
    Join Date
    May 2010
    Posts
    4

    Resolved [RESOLVED] VBScript runtime error 800a0009

    Fixed so removing the code
    Last edited by coolgirl; May 12th, 2010 at 01:17 PM.

  2. #2
    Frenzied Member
    Join Date
    Apr 2009
    Location
    CA, USA
    Posts
    1,516

    Re: VBScript runtime error 800a0009

    The "Subscript out of Range" error means you're trying to access an element of an array that doesn't exist; like if your array has 3 elements, and you try to access the 4th element. On line 123, you're using the aAppSrvs() array, which was defined as aAppSrvs(100,100), and the error message is telling you that "101" was used as either i or j. You either need to dim aAppSrvs with higher bounds, or you need to find out what's causing i or j to be 101 when they're expected to stay less than or equal to 100.

  3. #3
    PowerPoster
    Join Date
    Jun 2001
    Location
    Trafalgar, IN
    Posts
    4,121

    Re: VBScript runtime error 800a0009

    I assume this query is probably returning more than 101 record which will make the loop go beyond the bounds that you have delcared for the i dimension.

    72 sSQL = "SELECT e.* FROM tblEnvironment e WITH (nolock) WHERE e.RealEnvironment = 1 " _
    73 & "and e.EnvironmentActive = 1 ORDER BY e.SortOrder"

  4. #4

    Thread Starter
    New Member
    Join Date
    May 2010
    Posts
    4

    Re: VBScript runtime error 800a0009

    Quote Originally Posted by MarkT View Post
    I assume this query is probably returning more than 101 record which will make the loop go beyond the bounds that you have delcared for the i dimension.

    72 sSQL = "SELECT e.* FROM tblEnvironment e WITH (nolock) WHERE e.RealEnvironment = 1 " _
    73 & "and e.EnvironmentActive = 1 ORDER BY e.SortOrder"
    So what values should i change to make it work.

    I tried to change line # 27 value of svrs_per_env = 100 to 200 but still it did not work.

  5. #5

    Thread Starter
    New Member
    Join Date
    May 2010
    Posts
    4

    Re: VBScript runtime error 800a0009

    Quote Originally Posted by coolgirl View Post
    So what values should i change to make it work.

    I tried to change line # 27 value of svrs_per_env = 100 to 200 but still it did not work.
    Select by Application works fine but when I click select by Environment it gives me this error.

  6. #6
    PowerPoster
    Join Date
    Jun 2001
    Location
    Trafalgar, IN
    Posts
    4,121

    Re: VBScript runtime error 800a0009

    Give this a try.
    Change line 38 from
    Dim aAppSrvs(100, 100)
    to
    Dim aAppSrvs()

    then at line 119 add
    Redim aAppSrvs(UBound(aColumns), SVRS_PER_ENV)

    You will also have to update the code for aAppSrvsColor in the same way.

  7. #7

    Thread Starter
    New Member
    Join Date
    May 2010
    Posts
    4

    Re: VBScript runtime error 800a0009

    Quote Originally Posted by MarkT View Post
    Give this a try.
    Change line 38 from
    Dim aAppSrvs(100, 100)
    to
    Dim aAppSrvs()

    then at line 119 add
    Redim aAppSrvs(UBound(aColumns), SVRS_PER_ENV)

    You will also have to update the code for aAppSrvsColor in the same way.

    I tried Dim aAppSrvs(200, 200) and also for aAppSrvsColor(200, 200) and it worked.

    Thanks all for your help!

  8. #8
    PowerPoster
    Join Date
    Jun 2001
    Location
    Trafalgar, IN
    Posts
    4,121

    Re: VBScript runtime error 800a0009

    and it will continue to work until you return more than 201 records.

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width


×
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.