How to suppress a duplicate previous comment for a row
How to suppress a duplicate previous comment for a row
am 01.07.2005 04:53:13 von ynott
I'm grabbing info from a database. Because the application is not
perfect, a particular field duplicates a previous row. Is there a way
to code this ot. If so, any references would be appreciated.
Re: How to suppress a duplicate previous comment for a row
am 01.07.2005 09:38:21 von mmcginty
"ynott" wrote in message
news:8lb9c1ttek7qmj8adpgvu8mjmi2tvjmi2g@4ax.com...
> I'm grabbing info from a database. Because the application is not
> perfect, a particular field duplicates a previous row.
Not sure what this means, are you saying that one field is left with a
lingering value from the previous row, after clearing the inputs or moving
to a different row? If so, locate the code responsible for doing this
field's data exchange, and make sure there's no reason for it not to run.
I'm assuming you've considered the possibility of default value, trigger or
other server-side mechanism (depending on provider.)
You may want to post a more thorough description of the problem, with
relevant code if possible, as what you've posted so far doesn't give us much
to go on.
-Mark
> Is there a way
> to code this ot. If so, any references would be appreciated.
Re: How to suppress a duplicate previous comment for a row
am 01.07.2005 14:33:11 von reb01501
ynott wrote:
> I'm grabbing info from a database.
Never ask a database-related question without telling us the type and
version of datbase you are using. Failing to do so always causes delays in
getting helpful responses.
> Because the application is not
> perfect, a particular field duplicates a previous row.
That's not a fault of an application, it's a flaw in the design of the
database.
> Is there a way
> to code this ot. If so, any references would be appreciated.
Without details, all we can suggest is that before inserting data into your
table, run a query against the table that checks to see if the data already
exists.
Do you look at the other messages in the newsgroups before posting your
questions? There is a thread in this newsgroup with the subject "Preventing
duplicates" that was started just two days ago. You should be able to see it
in your newsreader without having to scroll. If you're using Access, that
thread may help you.
Bob Barrows
--
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"
Re: How to suppress a duplicate previous comment for a row
am 01.07.2005 20:07:03 von Foo Man Chew
If they are always in successive order, you can say:
previousComment = ""
do while not rs.eof
thisComment = rs("Comment")
if thisComment <> previousComment then
response.write thisComment
previousComment = thisComment
else
response.write "duplicate"
end if
rs.movenext
loop
Otherwise, fix the database to prevent duplicates, or at the very least,
write a better query.
"ynott" wrote in message
news:8lb9c1ttek7qmj8adpgvu8mjmi2tvjmi2g@4ax.com...
> I'm grabbing info from a database. Because the application is not
> perfect, a particular field duplicates a previous row. Is there a way
> to code this ot. If so, any references would be appreciated.
Re: How to suppress a duplicate previous comment for a row
am 01.07.2005 23:28:29 von Roland Hall
"Bob Barrows [MVP]" wrote in message
news:OVmaDkjfFHA.272@TK2MSFTNGP15.phx.gbl...
: Do you look at the other messages in the newsgroups before posting your
: questions? There is a thread in this newsgroup with the subject
"Preventing
: duplicates" that was started just two days ago. You should be able to see
it
: in your newsreader without having to scroll. If you're using Access, that
: thread may help you.
It helped me! (drum roll)
--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp