|
-
Jan 23rd, 2003, 12:22 PM
#1
Thread Starter
Hyperactive Member
This must be possible, but How?
I have this code :
Code:
<%
do while not RsNewham.eof
%>
<p><%=RsNewham("fieldname2")%></p>
<p><%=RsNewham("fieldname2")%> </p>
<%
RsNewham.movenext
Loop
%>
I can loop through my fields and display the contents that are held in a access DB. The problem is this. I have several recordsets. The user selects which one he wants to search through using a drop down. so i want the code to replace 'RsNewham' with the one that is selected.
To do this i wrote :
Code:
<%
Dim strSelectedChoice
strSelectedhoice = "Rs"+Request.form("select")
do while not StrSelectedChoice.EOF
%>
<p><%=StrSelectedChoice("Category")%></p>
<p><%=StrSelectedChoice("type_of_org")%> </p>
<%
StrSelectedChoice.movenext
Loop
My above code doesn't work but is it possible to insert the
recordset name from a form?
-
Jan 23rd, 2003, 12:42 PM
#2
This must be possible, but How?
No, its not possible. You use the recordset name being passed as the basis for a new Select statement to create the recordset object.
-
Jan 23rd, 2003, 12:49 PM
#3
Thread Starter
Hyperactive Member
so there's now way to get the details from a form and use that to to select which recordset i want?
-
Jan 23rd, 2003, 12:57 PM
#4
not like that ..no. Besides from what you are saying, you are persisting recordsets which you should NOT be doing.
In other words you shouldnt be selecting recordsets from a drop down. You should be selecting string representations of a recordset you want to open. Then detect which was selected by using if statements and opening a recordset based on what was choosen.
-
Jan 23rd, 2003, 03:26 PM
#5
Black Cat
It might be possible to use the Eval function to do what you want, but I agree with Cander in that there's better ways to do it.
http://msdn.microsoft.com/library/de.../vsfcteval.asp
Josh
Get these: Mozilla Opera OpenBSD
I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|