Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Duplicate entries


Message #1 by "Drew, Ron" <RDrew@B...> on Wed, 9 Jan 2002 17:50:30 -0500
This is a multi-part message in MIME format.



------_=_NextPart_001_01C19960.09B769F0

Content-Type: text/plain;

	charset="us-ascii"

Content-Transfer-Encoding: quoted-printable



I have an Access Database that contains a guestbook table where a person

puts on a form their name, email addr, blah, blah blah   then hits the

submit button.  Even though I indicate they must refresh, sometimes they

do not and retype the entry hitting submit again.  I have a delete form

for myself that allows me to monitor the guestbook to make sure I do not

get !#@$% <mailto:!#@$%>  type of information typed in.  I delete by the

NAME field after first displaying the results of the NAME selection in a

table. 

Question is:

If I have a duplicate for a good guest that just typed it twice, when I

delete it deletes both using the script below



sqltext =3D "DELETE FROM MYGUESTBOOK WHERE VISITORNAME =3D '" & 

form_name &

"'"



How can I only delete one of the two records?  Since I display it first

before I delete it, it shows 2 rows.  But when I pick one, the other

gets deleted also because of the sql statement above.  I thought I could

add the ROWID to the display, but it did not work for ACCESS.  In ORACLE

you can.  Is there any unique internal row ID or name within ACCESS.  I

really do not want to redesign the table to use internal row

assignments.  Any ideas out there???








Message #2 by gbrown@c... on Wed, 16 Jan 2002 12:03:48
Hi Ron



I use an autonumber field in acccess for this sort of thing.



Any hyperlinks then point to this number and not to whatever your key 

would be.



HTH



Regards

Graham



> This is a multi-part message in MIME format.

> 

> ------_=_NextPart_001_01C19960.09B769F0

> Content-Type: text/plain;

> 	charset="us-ascii"

> Content-Transfer-Encoding: quoted-printable

> 

> I have an Access Database that contains a guestbook table where a person

> puts on a form their name, email addr, blah, blah blah   then hits the

> submit button.  Even though I indicate they must refresh, sometimes they

> do not and retype the entry hitting submit again.  I have a delete form

> for myself that allows me to monitor the guestbook to make sure I do not

> get !#@$% <mailto:!#@$%>  type of information typed in.  I delete by the

> NAME field after first displaying the results of the NAME selection in a

> table. 

> Question is:

> If I have a duplicate for a good guest that just typed it twice, when I

> delete it deletes both using the script below

> 

> sqltext =3D "DELETE FROM MYGUESTBOOK WHERE VISITORNAME =3D '" & 

> form_name &

> "'"

> 

> How can I only delete one of the two records?  Since I display it first

> before I delete it, it shows 2 rows.  But when I pick one, the other

> gets deleted also because of the sql statement above.  I thought I could

> add the ROWID to the display, but it did not work for ACCESS.  In ORACLE

> you can.  Is there any unique internal row ID or name within ACCESS.  I

> really do not want to redesign the table to use internal row

> assignments.  Any ideas out there???

> 

> 

> 

> ------_=_NextPart_001_01C19960.09B769F0

> Content-Type: text/html;

> 	charset="us-ascii"

> Content-Transfer-Encoding: quoted-printable

> 

> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

> <HTML><HEAD>

> <META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; 

> charset=3Dus-ascii">

> <TITLE>Message</TITLE>

> 

> <META content=3D"MSHTML 5.50.4616.200" name=3DGENERATOR></HEAD>

> <BODY>

> <DIV><SPAN class=3D755053522-09012002><FONT face=3DArial size=3D2>I have 



> an Access

> Database that contains a guestbook table where a person puts on a form 

> their

> name, email addr, blah, blah blah&nbsp;&nbsp; then hits the submit 

> button.&nbsp;

> Even though I indicate they must refresh, sometimes they do not and 

> retype the

> entry hitting submit again.&nbsp; I have a delete form for myself that 

> allows me

> to monitor the guestbook to make sure I do not get !<A

> href=3D"mailto:!#@$%">#@$%</A> type of information typed in.&nbsp; I 

> delete by the

> NAME field after first displaying the results of the NAME selection in a 



> 

> table.&nbsp; </FONT></SPAN></DIV>

> <DIV><SPAN class=3D755053522-09012002><FONT face=3DArial 

> size=3D2>Question

> is:</FONT></SPAN></DIV>

> <DIV><SPAN class=3D755053522-09012002><FONT face=3DArial size=3D2>If I 

> have a

> duplicate for a good guest that just typed it twice, when I delete it 

> deletes

> both using the script below</FONT></SPAN></DIV>

> <DIV><SPAN class=3D755053522-09012002><FONT face=3DArial

> size=3D2></FONT></SPAN>&nbsp;</DIV>

> <DIV><SPAN class=3D755053522-09012002><FONT face=3DArial 

> size=3D2>sqltext =3D "DELETE

> FROM MYGUESTBOOK WHERE VISITORNAME =3D '" &amp; form_name &amp;

> "'"&nbsp;</FONT></SPAN></DIV>

> <DIV><SPAN class=3D755053522-09012002><FONT face=3DArial

> size=3D2></FONT></SPAN>&nbsp;</DIV>

> <DIV><SPAN class=3D755053522-09012002><FONT face=3DArial size=3D2>How 

> can I only

> delete one of the two records?&nbsp; Since I display it first before I 

> delete

> it, it shows 2 rows.&nbsp; But when I pick one, the other gets deleted 

> also

> because of the sql statement above.&nbsp; I thought I could add the 

> ROWID to the

> display, but it did not work for ACCESS.&nbsp; In ORACLE you can.&nbsp; 

> Is there

> any unique internal row ID or name within ACCESS.&nbsp; I really do not 

> want to

> redesign the table to use internal row assignments.&nbsp; Any ideas 

out

> there???&nbsp;</FONT></SPAN></DIV>

> <DIV><SPAN class=3D755053522-09012002><FONT face=3DArial

> size=3D2></FONT></SPAN>&nbsp;</DIV>

> <DIV>&nbsp;</DIV></BODY></HTML>

> 

> ------_=_NextPart_001_01C19960.09B769F0--

Message #3 by "Drew, Ron" <RDrew@B...> on Wed, 16 Jan 2002 08:39:55 -0500
Thanks for the feedback..I fixed it yesterday by just executing a read

before the insert for the same name and date then based on the EOF flag

either did the insert or told the visitor its there already.



I have one other question for the gurus out there.

I am now running AccessXP on my local PC coming from Access2000.  The

first time I changed the local AccessDB it converted it from 2000 to XP.

Here's the question.  I know the ISP is not running XP and I do not

think they have the Office suite running on the server.  So does the

version of Access make a difference.  Could I FTP the MDB on the ISP

server to me, change it and put it back without causing problems?  I

think the answer is YES and the ASPs just use ADO to get to the DB.

But???



Thanks

Ron



-----Original Message-----

From: gbrown@c... [mailto:gbrown@c...]

Sent: Wednesday, January 16, 2002 7:04 AM

To: ASP Databases

Subject: [asp_databases] Re: Duplicate entries





Hi Ron



I use an autonumber field in acccess for this sort of thing.



Any hyperlinks then point to this number and not to whatever your key

would be.



HTH



Regards

Graham



> This is a multi-part message in MIME format.

>

> ------_=3D_NextPart_001_01C19960.09B769F0

> Content-Type: text/plain;

> 	charset=3D"us-ascii"

> Content-Transfer-Encoding: quoted-printable

>

> I have an Access Database that contains a guestbook table where a

person

> puts on a form their name, email addr, blah, blah blah   then hits the

> submit button.  Even though I indicate they must refresh, sometimes

> they do not and retype the entry hitting submit again.  I have a

> delete form for myself that allows me to monitor the guestbook to make



> sure I do not get !#@$% <mailto:!#@$%>  type of information typed in.



> I delete by the NAME field after first displaying the results of the

> NAME selection in a table. =3D20 Question is:

> If I have a duplicate for a good guest that just typed it twice, when

I

> delete it deletes both using the script below

> =3D20

> sqltext =3D3D "DELETE FROM MYGUESTBOOK WHERE VISITORNAME =3D3D '" & 

=3D

> form_name &

> "'"=3D20

> =3D20

> How can I only delete one of the two records?  Since I display it

first

> before I delete it, it shows 2 rows.  But when I pick one, the other

> gets deleted also because of the sql statement above.  I thought I

could

> add the ROWID to the display, but it did not work for ACCESS.  In

ORACLE

> you can.  Is there any unique internal row ID or name within ACCESS.

I

> really do not want to redesign the table to use internal row

> assignments.  Any ideas out there???=3D20

> =3D20

> =3D20

>

> ------_=3D_NextPart_001_01C19960.09B769F0

> Content-Type: text/html;

> 	charset=3D"us-ascii"

> Content-Transfer-Encoding: quoted-printable

>

> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

> <HTML><HEAD> <META HTTP-EQUIV=3D3D"Content-Type" 

CONTENT=3D3D"text/html; =3D

> charset=3D3Dus-ascii">

> <TITLE>Message</TITLE>

>

> <META content=3D3D"MSHTML 5.50.4616.200" name=3D3DGENERATOR></HEAD> 

<BODY>

> <DIV><SPAN class=3D3D755053522-09012002><FONT face=3D3DArial 

size=3D3D2>I

have

=3D

> an Access=3D20

> Database that contains a guestbook table where a person puts on a form



> =3D their=3D20 name, email addr, blah, blah blah&nbsp;&nbsp; then hits 

the



> submit =3D button.&nbsp;=3D20

> Even though I indicate they must refresh, sometimes they do not and 

=3D

> retype the=3D20

> entry hitting submit again.&nbsp; I have a delete form for myself that

=3D

> allows me=3D20

> to monitor the guestbook to make sure I do not get !<A=3D20

> href=3D3D"mailto:!#@$%">#@$%</A> type of information typed in.&nbsp; I 

=3D

> delete by the=3D20

> NAME field after first displaying the results of the NAME selection in

a

=3D

>

> table.&nbsp; </FONT></SPAN></DIV>

> <DIV><SPAN class=3D3D755053522-09012002><FONT face=3D3DArial =3D

> size=3D3D2>Question=3D20 is:</FONT></SPAN></DIV>

> <DIV><SPAN class=3D3D755053522-09012002><FONT face=3D3DArial 

size=3D3D2>If I

=3D

> have a=3D20

> duplicate for a good guest that just typed it twice, when I delete it

=3D

> deletes=3D20

> both using the script below</FONT></SPAN></DIV>

> <DIV><SPAN class=3D3D755053522-09012002><FONT face=3D3DArial=3D20

> size=3D3D2></FONT></SPAN>&nbsp;</DIV>

> <DIV><SPAN class=3D3D755053522-09012002><FONT face=3D3DArial =3D

> size=3D3D2>sqltext =3D3D "DELETE=3D20

> FROM MYGUESTBOOK WHERE VISITORNAME =3D3D '" &amp; form_name &amp;=3D20

> "'"&nbsp;</FONT></SPAN></DIV>

> <DIV><SPAN class=3D3D755053522-09012002><FONT face=3D3DArial=3D20

> size=3D3D2></FONT></SPAN>&nbsp;</DIV>

> <DIV><SPAN class=3D3D755053522-09012002><FONT face=3D3DArial 

size=3D3D2>How

=3D

> can I only=3D20

> delete one of the two records?&nbsp; Since I display it first before I

=3D

> delete=3D20

> it, it shows 2 rows.&nbsp; But when I pick one, the other gets deleted

=3D

> also=3D20

> because of the sql statement above.&nbsp; I thought I could add the 

=3D

> ROWID to the=3D20

> display, but it did not work for ACCESS.&nbsp; In ORACLE you

can.&nbsp; =3D

> Is there=3D20

> any unique internal row ID or name within ACCESS.&nbsp; I really do

not =3D

> want to=3D20

> redesign the table to use internal row assignments.&nbsp; Any ideas

out=3D20

> there???&nbsp;</FONT></SPAN></DIV>

> <DIV><SPAN class=3D3D755053522-09012002><FONT face=3D3DArial=3D20

> size=3D3D2></FONT></SPAN>&nbsp;</DIV>

> <DIV>&nbsp;</DIV>

---<BR>

Change your mail options at http://p2p.wrox.com/manager.asp or <BR> to

unsubscribe send a blank email to

$subst('Email.Unsub').

</BODY></HTML>

>

> ------_=3D_NextPart_001_01C19960.09B769F0--




  Return to Index