Well this is how it works: the data is entered into a database somewhere, I
have no access to it, that data is then replicated to another database that
I have limited access to but can't change anything there, that is then
replicated to another database by my boss, it is that data that I have to
work with. Right now I simply want to capture when there is this overlap so
I can let my boss know. I'll just display the information and contact
information to the user. I have figured how I can do that now, I will just
use getrows() method. I will mention it to my boss that this is happening
so that maybe the error can be caught by his replication -- he's away on
vacation now.
I do not know how to find the version of the database that I have limited
access to, but the version we are using is SQL Server Enterprise Edition
8.00.760(sp3).
I will have to read up on cursors however, I've read before but didn't quite
understand, thanks.
I was wondering if you may have an answer to another question I posted in
inetexplorer.scripting (no one is answering it there, maybe wrong
newsgroup?) This is the text from that posting:
---
I have a intranet web app. I built at work. On one person's machine, when
they hit the back button after filling a form and submitting, they get the
warning 'page has expired...hit refresh, etc.' and then the refresh
requeries the database instead of just displaying the data in the form as it
was.
This doesn't happen on my machine. I searched knowledgebase and the other
person does not have "Do not
save encrypted pages to disk" checked and has IE
6.0.2900.2180.xpsp_sp2_rtm.040803-2158. I have 6.0.3790.0 update version
3283 (i'm running server 2003).
Does anyone know how to fix the problem on the other person's machine? I
want anyone who uses it to be able to enter data, submit it, go back and
make a few changes and submit it again as a new record, so they don't have
to refill a bunch of data that should still be there.
Thanks!
"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:eP*************@TK2MSFTNGP12.phx.gbl...
Recordcount will work if you specify the proper type of cursor (the
default cursortype will not produce a bookmarkable recordset). If you specify a
client-side cursor, recordcount will work (do you have the ADO
documentation handy? If not, go to msdn.microsoft.com/library and drill down into the
Data Access node in the TOC)
I am positive that there is a way to build a query that will give you your
overlapping ranges. Since this is a SQL database (MS SQL Server, I
assume - what version?), I am sure it is possible to use either constraints or a
trigger to prevent the invalid data. It is probably possible to prevent
the invalid entry in your stored procedure, or if you aren't using a stored
procedure, in your vbscript code. You should not resort to checking the
data after it is entered using an expensive client-side cursor.
Bob Barrows
mgm wrote: Sorry I didn't explain thoroughly before. The SQL database is not
returning "duplicate" rows, just 2 rows. My query is searching for a
serial number that is within a specific range - this serial number
range should only exist once in the database, but somehow, because of
someone else's input error I have overlapping ranges which should
never happen. This is an adhoc database that is fed by other
databases, used by many many people for our own reporting purposes.
I was just thinking recordcount should work somehow, but I guess it
doesn't in my case.
Thanks Bob!
"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:uu**************@tk2msftngp13.phx.gbl...
A better plan is to set up a unique index or primary key so that the
duplicates cannot occur. I cannot get into specifics because you did
not specify your database type and version, as well as the columns
in your table that are supposed to identify a unique record.
In the meantime, a grouping query will reveal the duplicate records:
select col1,col2
from tablename
group by col1,col2
having count(*) > 1
Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get
a quicker response by posting to the newsgroup.
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.