Solved

Double entries when inserting a new records...

Posted on 2002-07-19
4
148 Views
Last Modified: 2013-12-24
Hi Guys,

I have problem with inserting new records.  The problem is weird I must say.  Sometimes I get a double entries, sometimes I dont.  This is making me crazy as I never know when its gonna come out double again.

First of all, I checked on my code, its not running twice (most of friend told me this!).  

Secondly, I tried to query my table before inserting a new record, if found a same record (with the same batch of data), then delete it (not working too!!)

Thirdly, I put a <cflock> in all my insert statements, and it doesnt seems to work too.

So my question is, can anyone tell me what's going on here and how can I solve this as it comes and go, comes and go, unpredictable!

Thanks!
0
Comment
Question by:magicwizard
4 Comments
 
LVL 6

Expert Comment

by:dash420
ID: 7164801
There is one chance that u may click save button twice. That why may two same record got inserted. u can do one check before insert into table. just check already the record exist. means selects the count(1) form table where all the matching fields i.e. all form value.
 
0
 
LVL 17

Accepted Solution

by:
anandkp earned 100 total points
ID: 7164970
HI there,

u can also chk for the following :

u may have input type submit - right ???
now just chk if u have a onclick / onsubmit function being called for this image.

& if u r having some javascript validations for that page ... then chk at the end if u have written ...
frm.submit()

if this has happend - the form gets submitted twice -
once thru input type submit & 
secondly thru javascript frm.submit()

==========================================================

if what ive written above is not there - then pls chk what dash420 has written ...

else revert back with ur comments

K'Rgds
Anand
0
 
LVL 5

Expert Comment

by:Yog
ID: 7172848
are you using cftransaction at all ?
0
 

Author Comment

by:magicwizard
ID: 7173825
I found the problem was with the javascript.  But it still appear to be weird to me as I usually does submission using the javascript notation docuemnt.formName.submit() and it doesn't give me my current problem.

Anyway, I will accept this as the answer as it does solve my problem for the time being.

Thanks guys!!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
XML problem with Internet Explorer 7 40
PHP in Apache server 20 89
Nameserver and MX Record 2 63
In IIS redirect browser clients that do not support TLS 1.2 to another site 3 81
Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now