473,657 Members | 2,461 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*rn d)

Dim RS_rand
Set RS_rand = Server.CreateOb ject("ADODB.Rec ordset")
RS_rand.ActiveC onnection = conn_string
RS_rand.Source = "SELECT TOP 2 * FROM products WHERE product_New = 1
ORDER BY ((product_ID * " & F & "+" & R & ")Mod 1000);"
RS_rand.CursorT ype = 0
RS_rand.CursorL ocation = 2
RS_rand.LockTyp e = 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_CO DE, ticker) = RS_rand("produc t_ID")
prodArray(THUMB _CODE,ticker) = RS_rand("produc t_Thumb")

p_desc = RS_rand("produc t_Description_2 ")
if IsNull(p_desc) then
p_desc = RS_rand("produc t_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.CreateOb ject("ADODB.Rec ordset")
RS_URL.ActiveCo nnection = conn_string
SQL = "SELECT category_URL FROM categories WHERE category_ID = " &
RS_rand("catego ry_ID")
RS_URL.Source = SQL
RS_URL.Open()

prodArray(URL_C ODE,ticker) = RS_URL("categor y_URL")

RS_URL.Close()
Set RS_URL = Nothing
RS_rand.MoveNex t
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=""imghold er""><img
src=""../product-images/" & prodArray(THUMB _CODE,i) & """ alt=""""
width=""125"" /></div>"
RandomBox(i) = RandomBox(i) & "<a href=""../" & prodArray(URL_C ODE,i)
& "/product.asp?ID= " & prodArray(ID_CO DE,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 2102

"David" <go********@goo glemail.com> wrote in message
news:11******** **************@ i40g2000cwc.goo glegroups.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
5632
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 -------------------------------------------------------- 2Sports 'trouble shooting illustrated 'trouble shooting Newsstand 'trouble shooting
8
8497
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 don't know why. Briefly.... I have an array of Variants dimmed as this: Global gMyConnection() As Variant I redim it later like this:
51
23688
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 10018-clc.c: In function `main': 10018-clc.c:22: warning: array subscript has type `char' I don't like warnings ... or casts.
0
2113
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 FROM categories WHERE idCategory <> 1;" My connection string looks like this: connString = "Driver={Microsoft Access Driver (*.mdb)};DBQ=" &server.MapPath("../database/comersus.mdb")&";" set connTemp=server.createobject("adodb.connection")
6
2727
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 based on the const type. Infact if I use the Array on the left side i.e like a1 = 111 then it uses the first while if I use cout << a1 it uses the second... why????
6
11074
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 to a Windows PC and build it in MS VC++. Now I got a lot of "vector subscript out of range" assertion errors and I don't know why because on my Mac it is working without any error. What does the Mac with this problems and what is the magic behind...
13
4939
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 internet. When I run Firebug on it, it says: document.getElementById("TICKER") has no properties TICKER_CONTENT = document.getElementById("TICKER").innerHTML; Here is the complete script:
4
7085
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 Expression:vector subscript out of range.
6
12462
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 = bDayArr(0) ' subscript out of range Text2.Text = bDayArr(2) ' subscript out of range nextBday = nextBday + 1 End Sub
0
8392
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8305
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8823
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8726
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8503
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8603
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6163
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
1604
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.