Hi DarthSonic
I am getting value 1,2,3,... when i am running your code it is showing nothing.
thanks
Main Topics
Browse All TopicsHi
I am getting some value in array in my ASP page. Value like 1,2,3,4,... from database. I have a table like
table test
field2 field3
A 1
B 2
C 3
... ...
I want the value I am getting compare the value with my table and select A,B,C instead of 1,2,3 and if the value not match with table than show that value in page.
Thanks in advance
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
So my code is below, this is showing Type mismatch error
strValues = Request("F1")
arrValues = Split(strValues, ",")
For i = 0 To UBound(arrValues)
set rs = Conn.Execute("select * FROM test Where F1 = '"& arrValues & "'")
if not(rs.bof and rs.EOF) then
If rs("ID") = Request("F1") then
response.Write rs("ID")
End If
rs.MoveNext
end if
rs.Close
Next
Please can you tell me where is the problem in my code.
thanks in advance
Try this:
strValues = Request("F1")
arrValues = Split(strValues, ",")
For i = 0 To UBound(arrValues)
set rs = Conn.Execute("select * FROM test Where F1 = '"& arrValues(i) & "'")
if not(rs.bof and rs.EOF) then
If rs("ID") = Request("F1") then
response.Write rs("ID")
End If
rs.MoveNext
end if
rs.Close
Set rs = nothing
Next
You need the index in arrValues and you should not reuse an object (Set rs = nothing within loop).
Business Accounts
Answer for Membership
by: DarthSonicPosted on 2009-10-20 at 05:15:43ID: 25613211
myscript.asp?field3=2
3")
tion") set")
<%
field3_req = Request.QueryString("field
Set conn = CreateObject("ADODB.Connec
Set rs = CreateObject("ADODB.Record
conn.open ...
rs.open "SELECT field2 FROM test WHERE field3 = " & field3_req, ...
If Not (rs.BOF And rs.EOF) Then
field2_val = rs("field2")
Else
field2_val = field3_req
End If
rs.close
conn.close
Set rs = Nothing
Set conn = Nothing
Response.Write field2_val
%>