Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
Addinga value to array after oRS.GetRows()
Old 11-16-2005, 12:44 PM Addinga value to array after oRS.GetRows()
numbenator's Avatar
Webmaster Talker

Posts: 516
Location: London
Trades: 0
Hi ,
I have an array, GetUserAddresses which receives oRS.GetRows()

GetUserAddresses = oRS.GetRows()
my recordset is returning 1 field per record for a drop down list

Is it possible to add an additional value to GetUserAddresses

cheers

Steve
__________________

Please login or register to view this content. Registration is FREE
numbenator is offline
Reply With Quote
View Public Profile Visit numbenator's homepage!
 
 
Register now for full access!
Old 11-16-2005, 06:25 PM
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
You cannot change the number of dimensions in an array so redim() is out.

The only way would be to dim an array with the dimensions you require then transfer the getrows() array across and insert the extra data. This should add an extra column to the array
Code:
dim new_array(ubound(getRowsArray(1),GetRowsArray(2)+1)) 
for i = 0 to ubound(getRowsArray(1))
new_array(i,0) = GetRowsArray(i,0)
next
for i = 0 to ubound(getRowsArray(2))
new_array(i,1) = GetRowsArray(i,1)
next
for i = 0 to ubound(new_array(3))
new_array(i,2) = "new data for extra element"
next
Of course if you are just adding an extra row
it would be;
Code:
redim getRowsArray(ubound(getRowsArray(1)+1,ubound(getRowsArray(2)))
getRowsArray(ubound(getRowsArray(1),0))= "new col 1 data"
getRowsArray(ubound(getRowsArray(1),1))= "new col 2 data"
None of this is tested BTW. just writing code at the keyboard and with a (now) part bottle of red wine close by
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-17-2005, 04:50 AM
numbenator's Avatar
Webmaster Talker

Posts: 516
Location: London
Trades: 0
No, It's rows and columns.
Thanks for you input. it's a great help/
__________________

Please login or register to view this content. Registration is FREE
numbenator is offline
Reply With Quote
View Public Profile Visit numbenator's homepage!
 
Reply     « Reply to Addinga value to array after oRS.GetRows()
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.11255 seconds with 12 queries