Compare Dynamic Field to db Entry

S

Simon Gare

Hi

I need to compare a dynamic field in an asp page to a field in another
table, if there is no match then i would like to chane the row colour ( see
code below).

The problem Im having is that the comparison should be one of many entries
in that db field, at the moment it only compares the first field in the db.

Please Help

<tr
<%
Record = Recordset1.Fields.Item("COLL_CITY_TOWN").Value
Record2 = Recordset2.Fields.Item("TOWN").Value
If Record = Record2 Then
strbgcolor="#FFCC66"
Else
strbgcolor="silver"
End If
%>
bgcolor="<%=strbgcolor%>">

Regards
Simon
 
B

Bob Barrows [MVP]

This question is about asp and databases. Why crosspost to so many unrelated
groups? The most (and arguably, the only) relevant group is .asp.db. I'm
setting the followup-to to .asp.db.

Best practice is to pick one newsgroup to which to post. If you've chosen
the wrong one, usually someone will let you know. Irritating people* by
posting off-topic questions is not a good way to maximize your chances of
getting a reply.


* I'm not one of the irritated people: I'm trying to help you get your
answer to this and to future questions as quickly as possible.

See my response inline:
Simon said:
Hi

I need to compare a dynamic field in an asp page to a field in
another table, if there is no match then i would like to chane the
row colour ( see code below).

The problem Im having is that the comparison should be one of many
entries in that db field, at the moment it only compares the first
field in the db.
I don't understand your question. For one thing, you said you needed to
compare a "dynamic field in an asp page" to a "field in another table". In
your code, you compare a field from one recordset to a field in another
recordset.

Please clarify what you mean by "many entries", keeping in mind that
recordsets contain fields and records. Show us some of the data from each
recordset and show us what you want the result to be. I suspect you want to
perform a loop, but I'm really not clear what you want to do in that loop.

Bob b
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top