Group:  Microsoft Access ยป microsoft.public.access.adp.sqlserver
Thread: Compare db entry with dynamic text on asp page

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Compare db entry with dynamic text on asp page
"Simon Gare" <sg[ at ]simongare.com> 24.10.2005 05:20:00
Sorry I not making it clear,

If the dynamic filed on the asp page from recordset 1 was, for example,
London I neeed the code below to match 'London' to a list of entries in
Recordset 2 and return a row background colour based on the match. Recordset
2 is another table with a list of towns only.

<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

"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:%23joven11FHA.3560[ at ]TK2MSFTNGP15.phx.gbl...
[Quoted Text]
>
> Are you saying that you want to compare the entire record to the other
> record? What do you mean by "one of many entries in that db field?" Your
> current comparison should yield you a boolean result. What comparison did
> you want to do?
>
> Ray at home
>
>
> "Simon Gare" <sg[ at ]simongare.com> wrote in message
> news:e9TTRSz1FHA.3524[ at ]tk2msftngp13.phx.gbl...
> > 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
> >
> >
>
>



Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net