Old Access Translation of & Request("SUNum")(1) & (1 Viewer)

stanhook

New member
Local time
Today, 03:55
Joined
Dec 6, 2022
Messages
14
Hi,

I am new to access and I am trying to update a site I have inherited. There is an SQL statement in an ASP page that is requesting data from the URL:

Code:
& Request("SUNum")(1) &

This is in the URL:

Code:
&SUNum=110&

I am not understanding what the (1) is for. It is probably really common I am still lost. I have tried to look but I haven't found anything, probably because I am not asking the right question. So I thought I would ask here. Can someone please let me know?

Thanks!
 

ebs17

Well-known member
Local time
Today, 09:55
Joined
Feb 7, 2020
Messages
2,027
Code:
Request("SUNum")
... should contain a collection.
The suffix (1) then refers to the second element in this collection (counting starts at 0).
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 15:55
Joined
May 7, 2009
Messages
19,249
collection (counting starts at 0)
collection starts with 1.

when Option Base is set to 1, array element starts at 1, otherwise starts at 0.
 

ebs17

Well-known member
Local time
Today, 09:55
Joined
Feb 7, 2020
Messages
2,027
I do not know the collection mentioned.
I know that in IT, the count generally starts at 0, unless something else is explicitly declared (Excel sheets are the big exception).

If Option Base is not declared: Where is the start (= standard)?
Computers are still based on zeros and ones. It would be awkward to omit the zero.
 

ebs17

Well-known member
Local time
Today, 09:55
Joined
Feb 7, 2020
Messages
2,027
I trust that @stanhook can correctly determine for its own particular collection whether the first or second element is addressed.

when Option Base is set to 1
This is now also an assumption and no knowledge of real circumstances.
 
Last edited:

stanhook

New member
Local time
Today, 03:55
Joined
Dec 6, 2022
Messages
14
Hi,

Thank you all for your response. I had eventually assumed it was for a collection, but it still didn't make sense because there is only a single value in the URL. This is part of the statement where it is included:

Code:
SELECT tblPhotoManage.Date, tblPhotoSU.RecordCounter, tblPhotoSU.Site, tblPhotoSU.SUTypCode, tblPhotoSU.SUNum, ......

There are a bunch of joins and then

Code:
WHERE (((tblPhotoSU.SUNum) = '" & Request("SUNum")(1) & "') AND ((tblPhotoSU.Site) = '" & Request("Site") & "') AND ((tblPhotoManage.HUBVisible)=False))

SUNum is a number and could be 110, 9005, 16-n, or 1-s. There is only one number in the column in the database.

The whole query is rather long. I can paste that if anyone thinks that will help. I will see what I can figure out unless there are any other thought's.

Thanks, this forum is great!
Stan
 
Last edited:

Users who are viewing this thread

Top Bottom