473,569 Members | 2,737 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Compare Dynamic Field to db Entry

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.Fiel ds.Item("COLL_C ITY_TOWN").Valu e
Record2 = Recordset2.Fiel ds.Item("TOWN") .Value
If Record = Record2 Then
strbgcolor="#FF CC66"
Else
strbgcolor="sil ver"
End If
%>
bgcolor="<%=str bgcolor%>">

Regards
Simon
Oct 22 '05 #1
1 1957
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 Gare wrote:
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
<tr
<%
Record = Recordset1.Fiel ds.Item("COLL_C ITY_TOWN").Valu e
Record2 = Recordset2.Fiel ds.Item("TOWN") .Value
If Record = Record2 Then
strbgcolor="#FF CC66"
Else
strbgcolor="sil ver"
End If
%>
bgcolor="<%=str bgcolor%>">


--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Oct 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1522
by: Kivak | last post by:
Hey, I have two tables of data, table1 and table2. In Table1, there is a "id" field, a "name" field, and an e-mail field. In table2, there is an "id" field, and paramters that belong to the certain "id". When I want to create a new record, I want to make both of the entries at the same time and have their "id"s match. I thought that the...
2
1922
by: Ian Vincent | last post by:
I am hoping someone may be able to help. I am using Python and TKinter to create a GUI program that will eventually create an XML file for a project I am working on. Now, the XML file contents changes depending on the type of file it represents - so I am dynamically creating the TK Entry boxes. The problem is, I want the variable assigned...
5
10857
by: Megan | last post by:
Hi everybody- I'm helping a friend with a music database. She has an old one and is creating a new one. She wants to compare records and fields in the old database with records and fields in the new database. For instance, her old database has a table with Band Info in it. Her new database also has a table with Band Info in it but slightly...
3
8202
by: Bob Alston | last post by:
I am using a combo box to select the key to records and then go to the selected record on my form. Works well. However, the list, which contains people names, is rather long. What I would like to do is to allow entry of one or more letters of the beginning of the last name, like "j" for someone named Johnson (or Johnston) , where the list...
1
2645
by: Nathan Sokalski | last post by:
When testing a form of mine which uses RequiredFieldValidators that have the Display property set to "Dynamic" the ErrorMessage property is automatically removed when an entry is completely typed and the user leaves the textbox. However, if the entry is selected from the list of previously typed entries, the error does not disappear until the...
5
6325
by: rcolby | last post by:
Evening, Wondering if someone can point me in the right direction, on how I would compare a system.guid with a system.byte. system.guid (pulled from sql server table with a data type of uniqueidentifier, originally taken from objectGUID from active directory domain)
7
22479
by: Mike Livenspargar | last post by:
We have an application converted from v1.1 Framework to v2.0. The executable references a class library which in turn has a web reference. The web reference 'URL Behavior' is set to dynamic. We added an entry to the executable's .exe.config file to specify the URL, and under the 1.1 framework this worked well. Unfortunately, this is not...
17
4504
by: Mark A | last post by:
DB2 8.2 for Linux, FP 10 (also performs the same on DB2 8.2 for Windoes, FP 11). Using the SAMPLE database, tables EMP and EMLOYEE. In the followng stored procedure, 2 NULL columns (COMM) are selected into 2 different SP variables and compared for equal. They are both NULL, but do not compare as equal. When the Not NULL columns (SALARY)...
3
9566
by: super.raddish | last post by:
Greetings, I am relatively new to, what I would call, advanced XSLT/XPath and I am after some advice from those in the know. I am attempting to figure out a mechanism within XSLT to compare the difference between two source documents and output node-sets which are "different" (changed or new) to new XML files using xsl:result-document To...
0
7614
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8125
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7974
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6284
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5513
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2114
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.