473,503 Members | 8,784 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Subscript out of range: 'ticker' ?????

Hi, I have the following asp in my page, but I keep getting the
following error

Microsoft VBScript runtime error '800a0009'

Subscript out of range: 'ticker'

Please can you help me ?. Here is the page code I have so far:
---------------------------------
<%
Randomize
R=clng(1E6*rnd)
F=1+clng(1E3*rnd)

Dim RS_rand
Set RS_rand = Server.CreateObject("ADODB.Recordset")
RS_rand.ActiveConnection = conn_string
RS_rand.Source = "SELECT TOP 2 * FROM products WHERE product_New = 1
ORDER BY ((product_ID * " & F & "+" & R & ")Mod 1000);"
RS_rand.CursorType = 0
RS_rand.CursorLocation = 2
RS_rand.LockType = 1
RS_rand.Open()

Dim prodArray(3,2)
ID_CODE = 0
THUMB_CODE = 1
DESC_CODE = 2
URL_CODE = 3

ticker = -1

If NOT (RS_rand.EOF) OR NOT(RS_rand.BOF) then
While NOT RS_rand.EOF
ticker = ticker + 1

prodArray(ID_CODE, ticker) = RS_rand("product_ID")
prodArray(THUMB_CODE,ticker) = RS_rand("product_Thumb")

p_desc = RS_rand("product_Description_2")
if IsNull(p_desc) then
p_desc = RS_rand("product_Description")
end if
if (Len(p_desc) >= 60 ) then
space_pos = InStr(120, p_desc, " ") - 1
p_desc = Left(p_desc, space_pos) & "..."
end if
prodArray(DESC_CODE,ticker) = p_desc

Set RS_URL = Server.CreateObject("ADODB.Recordset")
RS_URL.ActiveConnection = conn_string
SQL = "SELECT category_URL FROM categories WHERE category_ID = " &
RS_rand("category_ID")
RS_URL.Source = SQL
RS_URL.Open()

prodArray(URL_CODE,ticker) = RS_URL("category_URL")

RS_URL.Close()
Set RS_URL = Nothing
RS_rand.MoveNext
WEnd
End If

RS_rand.Close()
Set RS_rand = Nothing

' Super. We have the info in our array. Now let's make the html:
Dim RandomBox(3)
for i = 0 to ticker step 1
RandomBox(i) = "<div class=""imgholder""><img
src=""../product-images/" & prodArray(THUMB_CODE,i) & """ alt=""""
width=""125"" /></div>"
RandomBox(i) = RandomBox(i) & "<a href=""../" & prodArray(URL_CODE,i)
& "/product.asp?ID=" & prodArray(ID_CODE,i) & """>" &
prodArray(DESC_CODE, i) & " <span class=""obvious"">read more<i>
&raquo;</i></span></a>"
next

%>

------------------------------

Thanks so much

David

Mar 1 '06 #1
1 2094

"David" <go********@googlemail.com> wrote in message
news:11**********************@i40g2000cwc.googlegr oups.com...
Hi, I have the following asp in my page, but I keep getting the
following error

Microsoft VBScript runtime error '800a0009'

Subscript out of range: 'ticker'

Please can you help me ?. Here is the page code I have so far:
---------------------------------

<snip/>


Can't see anything obvious. Which Database are you using? It looks like
you are doing a lot of work in Script that you should be doing in SQL
instead resulting a much simpler ASP.
Mar 2 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
5612
by: andy.rich | last post by:
I am getting the following error and I do not know why. Can anyone help? -------------------------------------------------------- this is what appears on the screen...
8
8487
by: VB Programmer | last post by:
I'm acutally using VB6, not VB.NET, but I couldn't find the newsgroup for version 6.... I need help for something that should be simple. I keep getting a "subscript out of range" error and...
51
23623
by: Pedro Graca | last post by:
I run into a strange warning (for me) today (I was trying to improve the score of the UVA #10018 Programming Challenge). $ gcc -W -Wall -std=c89 -pedantic -O2 10018-clc.c -o 10018-clc...
0
2107
by: wennerd | last post by:
I am getting a Subscript out of range after executing the following command Set oRstPick = connTemp.Execute(sSQL) It is a simple query: sSQL = "SELECT idCategory, categoryDesc, idParentCategory...
6
2716
by: josh | last post by:
Hi I've a dubt! when we have overloaded functions the compiler chooses the right being based on the argument lists...but when we have two subscript overloaded functions it resolves them being...
6
11062
by: Andy | last post by:
Hi all, I started developing a little app on my Mac using XCode some month ago. The app is running fine on my mac like a sharm. Now I am nearly ready and yesterday I moved the whole source code...
13
4913
by: RommelTJ | last post by:
Hi, My website (http://www.justiceinmexico.org/indextest.php) looks good in Firefox, but horrible in IE, and I think it's because of an error in the javascript of a free web ticker I got off the...
4
7075
by: Han | last post by:
when I exe my project in vs.net2005,I got the error following: Debug Assertion Failed! Program:........ File:c:\program files\microsoft visual studio 8\vc\include\vector Line:756 ...
6
12453
by: brandon01 | last post by:
Keep getting "subscript out of range" any idea why? This function is looped btw.. Thx... Private Sub getBday() bDay = List1.List(nextBday) bDayArr = Split(bDay, " - ") Text1.Text =...
0
7194
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7070
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
6976
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5566
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4993
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4666
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3148
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1495
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
372
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.