|
 |
access_asp thread: Dynamic Recordsets
Message #1 by "Ashley Young" <ashley.young@c...> on Tue, 13 Aug 2002 17:10:26
|
|
I posted a message a while back asking how to obtain multiple values from
list boxes. Everyone that answered gave me great suggestions that worked
beautifully. However, I have a new problem that hopefully someone can help
me with.
I would like to make multiple recordsets dynamically named after the
listbox.count like:
for intCount = 1 to request.form("mf").Count
sqlStatement(intCount) = "select * from manufactuers where blabh"
i.e. sqlStatement3 = "...."
next
I just can't figure out how to get the intCount to be accepted after the
sqlStatement as a variable. Is there a way to do this? I'm sure it's
simple and I'm overlooking something.
ALL help is appreciated.
Message #2 by "Ken Schaefer" <ken@a...> on Wed, 14 Aug 2002 11:00:25 +1000
|
|
You can create a variant array, and store a string in each array element.
Dim arrSQLStatements()
' Redim to the necessary number of elements
' Note that arrays are 0-lower bound, so we subtract
' 1 from the collection count
ReDim arrSQLStatements(Request.Form("mf").Count -1)
That said, /why/ do you need to create a lot of recordsets? Databases (and
SQL) is set based - if you can create a single set of records that will be a
lot more efficient than creating multiple cursors each with a single record
in each set.
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Ashley Young" <ashley.young@c...>
Subject: [access_asp] Dynamic Recordsets
: I posted a message a while back asking how to obtain multiple values from
: list boxes. Everyone that answered gave me great suggestions that worked
: beautifully. However, I have a new problem that hopefully someone can help
: me with.
: I would like to make multiple recordsets dynamically named after the
: listbox.count like:
:
: for intCount = 1 to request.form("mf").Count
: sqlStatement(intCount) = "select * from manufactuers where blabh"
: i.e. sqlStatement3 = "...."
: next
:
: I just can't figure out how to get the intCount to be accepted after the
: sqlStatement as a variable. Is there a way to do this? I'm sure it's
: simple and I'm overlooking something.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
 |