Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Duplicate records problem


Message #1 by gbrown@c... on Wed, 14 Nov 2001 16:10:36
Hi all



My app has a form which when submitted does insert into sql commands. 



On one machine though I have odd duplicate records appearing doesn't 

happen all the time though.



The user insists they are not submitting twice or anything like that 

although I am in the process of putting in a javascript confirm in the 

submit onclick.



Has anyone come across anything similar and could shed any light.



tia



Regards

Graham

Message #2 by imran.saleem@b... on Wed, 14 Nov 2001 16:14:35 -0000
I am sure u know this already but inthe QL st. add DISTINCT after the SELECT

keyword.



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

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

Sent: Wednesday, November 14, 2001 4:11 PM

To: ASP Databases

Subject: [asp_databases] Duplicate records problem





Hi all



My app has a form which when submitted does insert into sql commands. 



On one machine though I have odd duplicate records appearing doesn't 

happen all the time though.



The user insists they are not submitting twice or anything like that 

although I am in the process of putting in a javascript confirm in the 

submit onclick.



Has anyone come across anything similar and could shed any light.



tia



Regards

Graham



 




$subst('Email.Unsub')

Message #3 by gbrown@c... on Wed, 14 Nov 2001 16:24:28
Hi



Thanks for taking the time to reply!



I am not using a select statement I am using an Insert statement, take the 

point though that I could run a select before every insert and see if I 

have a duplicate.



Just wondering if there is any way the request could be fired twice on one 

click of the submit button.



Regards

Graham



> I am sure u know this already but inthe QL st. add DISTINCT after the 

SELECT

> keyword.

> 

> -----Original Message-----

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

> Sent: Wednesday, November 14, 2001 4:11 PM

> To: ASP Databases

> Subject: [asp_databases] Duplicate records problem

> 

> 

> Hi all

> 

> My app has a form which when submitted does insert into sql commands. 

> 

> On one machine though I have odd duplicate records appearing doesn't 

> happen all the time though.

> 

> The user insists they are not submitting twice or anything like that 

> although I am in the process of putting in a javascript confirm in the 

> submit onclick.

> 

> Has anyone come across anything similar and could shed any light.

> 

> tia

> 

> Regards

> Graham

> 

>  




> $subst('Email.Unsub')

Message #4 by "Drew, Ron" <RDrew@B...> on Wed, 14 Nov 2001 11:42:21 -0500
If this is a guestbook that the user can then see what was input, you may

have to do a refresh for them.  My first guestbook had that problem and yes

they did do a submit twice cause they did not see it when viewing.



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

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

Sent: Wednesday, November 14, 2001 11:11 AM

To: ASP Databases

Subject: [asp_databases] Duplicate records problem





Hi all



My app has a form which when submitted does insert into sql commands. 



On one machine though I have odd duplicate records appearing doesn't 

happen all the time though.



The user insists they are not submitting twice or anything like that 

although I am in the process of putting in a javascript confirm in the 

submit onclick.



Has anyone come across anything similar and could shed any light.



tia



Regards

Graham



 

---

You are currently subscribed to asp_databases as: RDrew@B... To

unsubscribe send a blank email to $subst('Email.Unsub')

Message #5 by "Curtis Barnett" <cfb@s...> on Wed, 14 Nov 2001 11:29:03 -0600
Timely! It just so happens that I literally just finished "fixing" a

potential multiple entry problem. Some of my users are impatient and will

continue clicking on a button until the screen repaints and the button is no

longer there. Depending on the time of a round-trip to the server , there

can be "lots" of multiples. Whenever I have a "Submit" button of any kind

which causes a write, I try to include an onClick event that disables the

button. One click, one event, no duplicates. Usually a JavaScript function

that 1) Disables the button and 2) Submits the form.



<SCRIPT LANGUAGE="JavaScript">

function Button_onClick()

{

Document.myForm.myButton.disabled=true;

docuemnt.myForm.submit();

{

</SCRIPT>



<FORM NAME="myForm" ....>

<INPUT TYPE="Button" NAME="myButton" VALUE="Submit"

onClick="Button_onClick();">

</FORM>



CFB



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

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

Sent: Wednesday, November 14, 2001 4:24 PM

To: ASP Databases

Subject: [asp_databases] RE: Duplicate records problem





Hi



Thanks for taking the time to reply!



I am not using a select statement I am using an Insert statement, take the

point though that I could run a select before every insert and see if I

have a duplicate.



Just wondering if there is any way the request could be fired twice on one

click of the submit button.



Regards

Graham



> I am sure u know this already but inthe QL st. add DISTINCT after the

SELECT

> keyword.

>

> -----Original Message-----

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

> Sent: Wednesday, November 14, 2001 4:11 PM

> To: ASP Databases

> Subject: [asp_databases] Duplicate records problem

>

>

> Hi all

>

> My app has a form which when submitted does insert into sql commands.

>

> On one machine though I have odd duplicate records appearing doesn't

> happen all the time though.

>

> The user insists they are not submitting twice or anything like that

> although I am in the process of putting in a javascript confirm in the

> submit onclick.

>

> Has anyone come across anything similar and could shed any light.

>

> tia

>

> Regards

> Graham

>

>




> $subst('Email.Unsub')












Message #6 by David Cameron <dcameron@i...> on Thu, 15 Nov 2001 15:55:34 +1100
This message is in MIME format. Since your mail reader does not understand

this format, some or all of this message may not be legible.



------_=_NextPart_001_01C16D91.C5DB3E90

Content-Type: text/plain;

	charset="iso-8859-1"



From memory this will only work with IE4+ and maybe NS6+.



Another option is to set a global variable once the page is submitted:



<script language="javascript">



var NotSubmitted = true;



function SubmitForm(curForm) {



	if (NotSubmitted) {

		NotSubmitted = false;

		curForm.submit();

	} else {

		alert("The form has been submitted, please wait for it to

clear")

	}



}



</script>



<FORM NAME="myForm" ....>

<INPUT TYPE="Button" NAME="myButton" VALUE="Submit"

onClick="SubmitForm(this.form);">

</FORM>



regards

David Cameron

nOw.b2b

dcameron@i...



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

From: Curtis Barnett [mailto:cfb@s...]

Sent: Thursday, 15 November 2001 3:29 AM

To: ASP Databases

Subject: [asp_databases] RE: Duplicate records problem





Timely! It just so happens that I literally just finished "fixing" a

potential multiple entry problem. Some of my users are impatient and will

continue clicking on a button until the screen repaints and the button is no

longer there. Depending on the time of a round-trip to the server , there

can be "lots" of multiples. Whenever I have a "Submit" button of any kind

which causes a write, I try to include an onClick event that disables the

button. One click, one event, no duplicates. Usually a JavaScript function

that 1) Disables the button and 2) Submits the form.



<SCRIPT LANGUAGE="JavaScript">

function Button_onClick()

{

Document.myForm.myButton.disabled=true;

docuemnt.myForm.submit();

{

</SCRIPT>



<FORM NAME="myForm" ....>

<INPUT TYPE="Button" NAME="myButton" VALUE="Submit"

onClick="Button_onClick();">

</FORM>



CFB



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

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

Sent: Wednesday, November 14, 2001 4:24 PM

To: ASP Databases

Subject: [asp_databases] RE: Duplicate records problem





Hi



Thanks for taking the time to reply!



I am not using a select statement I am using an Insert statement, take the

point though that I could run a select before every insert and see if I

have a duplicate.



Just wondering if there is any way the request could be fired twice on one

click of the submit button.



Regards

Graham



> I am sure u know this already but inthe QL st. add DISTINCT after the

SELECT

> keyword.

>

> -----Original Message-----

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

> Sent: Wednesday, November 14, 2001 4:11 PM

> To: ASP Databases

> Subject: [asp_databases] Duplicate records problem

>

>

> Hi all

>

> My app has a form which when submitted does insert into sql commands.

>

> On one machine though I have odd duplicate records appearing doesn't

> happen all the time though.

>

> The user insists they are not submitting twice or anything like that

> although I am in the process of putting in a javascript confirm in the

> submit onclick.

>

> Has anyone come across anything similar and could shed any light.

>

> tia

>

> Regards

> Graham

>

>




> $subst('Email.Unsub')








$subst('Email.Unsub')







 




$subst('Email.Unsub')





  Return to Index