Multi-Dimentional Dynamic Array
I want to save the details of a SQL search into an Array, Im dabbling and tryin the script below but i get an error Script:
SQL = "select item, number from table"
Set rsTarg = Conn.Execute(SQL)
i = 0
Dim TargArray()
Redim TargArray(i, 1)
do until rsTarg.eof
TargArray(i, 0) = rsTarg("item")
TargArray(i, 1) = rsTarg("number")
i = i + 1
Redim Preserve TargArray(i, 1)
rsTarg.movenext
loop
rsTarg.close
i = i -1
View Replies
ADVERTISEMENT
I try to store a two-dimentional array in a session variable. When I do the
same with a one-dimentional array, it works fine, but with a two-dimentional
array it fails. Is this not possible? Is there something special I have to
take into account?
View Replies
View Related
I needed to print the values of a multidim array. I know it can be done by saying <%=array(i,j)%>. But my array is three dimensional and doesn't print any values if i say <%=array(i,j,k)%>. This array was declared as Dim vretdata and what it does it retrieves data from the database through a function. Code:
View Replies
View Related
I needed to print the values of a multidim array. I know it can be done by saying <%=array(i,j)%>. But my array is three dimensional and doesn't print any values if i say <%=array(i,j,k)%>. This array was declared as Dim vretdata and what it does it retrieves data from the database through a function. Code:
View Replies
View Related
As part of the development of a shopping basket function, I've a two dimensional aray which I'm storing in the session variable.
I want the array to be dynamic to store any amount of products which may added.
I am getting a problem when trying to write to the second row to the array, saying that the subscript is out of range...
You can see an example of this at:
http://www.foulkestudios.com/session.asp
I am getting what should be the first empty row by getting rows=UBound(myArray,2)
I'm then trying to add into the next row by using rows + 1
View Replies
View Related
what i want to do is have a (multi dimensional?) array, so that each second dimension represnts a row of radiobuttons. The trouble is i don't know what to name the arrays as. Obviously for each row the names for the different radio buttons will be the same, meaning you can only select one.
in php you could do it with a single array as you name each row of radio button differently:
1st row:
name='array[0]'
2nd:
name='array[1]'
in asp it doesn't look like you can do it this way, because to create a similar array you'd do something like
1st row:
name='array'
2nd
name='array'
then use split in the recipient script. This does not work however, because each radiobutton (on all rows) has the same name, and therefore when you click one all the rest on every row are unclicked..
View Replies
View Related
What I need to do is sort an dimention array by the name field and the best way I can think of to do this is by a bubble sort. However, I'm running into a problem with the bubble sort and I'm sure I'm just missing something simple.Here is the code I have Code:
Dim objAllBrands, objBubbleArray, a, i
For i = 1 to objAllBrands.count
For a = 1 to objAllBrands.count
If objAllBrands.item(a).Name < objAllBrands.item(i).Name then
objBubbleArray = objAllBrands.item(i)
objAllBrands.item(i) = objAllBrands.item(a)
objAllBrands.item(a) = objBubbleArray
End if
Next
Next
It doesn't like this line objBubbleArray = objAllBrands.item(i) and I'm sure there are other problems. Can anyone give me a hand with this?
View Replies
View Related
I am trying to create a dynamic multi-dimensional array, based on a count from a database. The count is correct, but when I try to Redim preserve my array, I get an error...
Subscript out of range
referring to the line of code...
ReDim Preserve builderArray(CInt(builderCount),5)
How can I do this redim successfully?
View Replies
View Related
I code that creates a calendar for each month and then it displays events from that month that are stored in a db. I need to loop through my recordset and display all the events, but I can't quite figure out how to do it. I am thinking I need to do an array. But I am not really sure.... any ideas. Here is where you can view the calendar. Code:
View Replies
View Related
to keep things simple.. lets juz say i hav the following:
Code:
<%
dim i,j
dim region1(0)
region1(0) = 5
i=1
j=0
response.write (region&i&(j))
%>
the above output i got is 10.. so how do i the value of 5 printed instead
View Replies
View Related
how can we declare a dynamic array in asp.say i have a counter name COUNT.how to i declare an array of size COUNT.its not DIM array(COUNT) cos it will give me a error.how is it done?
View Replies
View Related
I intend to have a dynamic array of non fixed size
set rsseats = conn.execute("select * from seats")
Dim arr(1)
response.write ubound(arr)
do while not rsseats.eof
ReDim arr(ubound(arr)+1)
rsseats.movenext
loop
set rsseats = nothing
But i will get hit with "The array is fixed or temp locked" how should i fix that
View Replies
View Related
Does anyone know how to create a dynamic array? I need assign the values from database to the array one by one. I did a search and I can only find some complicated dynamicarray class. I am not to ASP and I have used other programming language. I thought a dynamic array shouldn't be that complicated.
View Replies
View Related
I wrote a simple code to generate a dynamic array:
Dim TestArray2()
TestArray2=array()
Redim TestArray2(43)
When I uploaded this to IIS (on Vista Basic), the following error
message was given:
"An error occurred on the server when processing the URL. Please
contact the system administrator"
May I know what is the problem?
View Replies
View Related
how do i create a array rs, not sure if the terminology is correct. but i don't want a obj rs i want a array.
View Replies
View Related
is there any way tohave an array where the first subscript is dynamic and the second subscript is static
View Replies
View Related
Ok, given a string such as this -
203_2_0_0_1_5_0_234_0_8_22_2_0_3_345_2_3_0_0_0_9
Each three digit number in the string represents a unique ID of a file in a database. Following each ID are six digits, all seperated by a "_" . Each file will ALWAYS have six subsequent integers, such as above ID "234" has "_0_8_22_2_0_3_" following it.
What I am trying to figure out is given a string of any length of this specific pattern, how to decarle a multi dimensional array that would hold each ID and its corresponding digits.
To clarify a little further, this is from a shopping cart for a photographer. Each "ID" represents an image, each of the six corresponding numbers for each ID represents a qty for an image print size, ie., 4 4x6's, 5 5x7s, 0 8x10s, 1 16x20, 23 20x30's, 48 wallets. Oh, and the image ID's are not necessarily always going to be 3 digits, they could be of any lenght integer...
View Replies
View Related
I've probably done this before, but for the life of me I can't remember how
I did it. I need to move values from a DB table into an array to be used
for other queries. The number of records will vary, so I need to make the
array dynamic. Can someone remind me how I can increment the index when I
write a new record? Code:
View Replies
View Related
I dump the entire recordset into an array:
If not rs.EOF Then
aEmp = rs.GetRows()
Contents of the array are in this order:
EmpID,EmpName,Indent,Sub_ID,Lft,Rgt,MgrID, LastName
This query sort on the basis of Lft and Rgt columns.
The name of the array is: aEmp.
My question here is how can I get only the LastName from the aEmp array into another array so that I can sort the names alphabetically and then display the employees in the alphabetical order.
Or is there is another way I could this by using the same array while keeping the lft and rgt sort of the query? If I sort based at the SQL query level, I can see the names sorted by the lft, rgt and lastname, but since the lastname is at the end of the sort list - it does not appear alphabetically.
View Replies
View Related
In working with arrays, I have found that I am unable to dimension and array
with a variable that has an integer value but I can redimension one this
way. I haven't see any information that tells me if this is a requirement,
although it appears to be because I get an error if I try it.
Ex.
Dim b
b = 10
Dim a(b) ' this errors out but
Dim a() ' this
Redim a(b) ' works
Code:
View Replies
View Related
I released to open source a while back but forgot to post in here a DLL that was used in some of our older developments. It's not really a live project, but may be of use to peeps in here given some of the recent queries:Quote:
DBSite: Written in Visual Basic this DLL helps solve issues for ASP web developers, e.g. handling uploads, safe parameter population for stored procedures (sql injection checks), SQL XML calls, file system browsing, etc.
View Replies
View Related
I was trying:
Code:
<!--#include file="lang/<%= Request.QueryString("lang") %>.asp"-->
But it doesn’t work.
View Replies
View Related
How can i create a multi tab page in asp.net 2.0?
create a frame and a number of page with hyperlink?
Would i have some directives?
View Replies
View Related
How can I update/delete a record which is linked to another table with a
unique field. I know the select inner join, but no update/delete.
View Replies
View Related
Trying to join three tables and find the records which DON'T match OR have less than x number of matches.Not sure how to go about it.keep getting matching fields only.
View Replies
View Related
I need to create in asp/access/javascript a questionnaire that shows a single question on each page of which there are five then after the last question create a new record in the access db and write the answers.
View Replies
View Related
lets say we have a ms db with two cols
id value
1 4
2 7
3 9
4 1
is there a simple way of updating all the value fields with one form? so i can have the page lay the four value's out in a list, the user could then edit them and hit update and this would update all the value fields. i can update single records no problem but have no idea where to start with this one.
View Replies
View Related
I have written a asp application whihc uses a number of pages and each page connects to a sql database.
Currently I have the connection script coded on each page however if i need to change the database I have to change every page.
I have been told there is a way to have the connection on one page and each page to referance this one so I only need to change the one page
View Replies
View Related
I am b-testing a community site, with currently 1,000 or so membership,
and low concurrency, say no more than 5 on-line at once.
The site is hosted on a shared server, which is sufferening from
intermittent accute slowness, affecting all other hosted sites as well as
mine.
The finger of suspicion is pointing at me and possible sloppy code. As
this is the first site I have done of this nature, could someone recommend
reading matter (knowledge bases etc), especially coding samples, in
connection with data connections (opening and closing connections and
objects) and record locking issues, which if improperly coded, could
contribute to throughput bottlenecks due to inefficient use of resources so
that I can check out my pages and correct any nasties..
View Replies
View Related
I am think to write a code that will need more then 2 servers.
Can anyone give me some information to do code like that?
Like yahoo, google, msn.
View Replies
View Related
I need to develop an application that will span 12 or so pages, and on the
last page, it lets the user review the data and then insert it all. This is
kind of like selling something on eBay, you give it information, click next,
enter more info and then at the end you review and submit the item. I was
thinking about sessions, but some of the fields are pretty big, like
varchar(5000) so I didn't know if there was a way to handle these big
fields.
View Replies
View Related
I am in the process of developing several web sites that will accommodate up to 3 or 4 languages. The sites are not that complex, but will use an Access database for some data presentation/storage. Each page will have a series of flags for respective languages. Ideally, if someone enters on a "gateway" page for say Gallery, and they choose another language, I would like the same page to display but in a different language (there might be a page for each language, but if I can avoid that I'd rather).
So here are my thoughts on how to approach this. Have a session var for language preference and set it in a Global.asa file. I would think it could be set dependant on the origin of the request, .de, .co.uk, .it, etc. Then, if the code is not too verbose, use Case statements in the code to display content based on language preference. One thing of a bit challenging for me is that if the "flags" are in an include file, how can I get them to when clicked go to a script, change the session variable and return to the page from which it was clicked. Am I on the right track with this approach.
View Replies
View Related
I have a database full of info and I have display.asp which I want to display 10 items at a time so I have display.asp?page=1, display.asp?page=2, etc.
How do I go about actually filtering the database to only produce 10 results per page? I was trying to use:
results.Move 10
and things like that, but I'm not sure of the best way around this.
View Replies
View Related