Solved

Double entries when inserting a new records...

Posted on 2002-07-19
4
173 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Need to Configure Debug Diag 2.2 for IIS 7.5 to capture dump files 1 90
Domino Website - Redirection 12 125
DNS @ Naked Domain Record 5 132
app server have enough resources... 2 68
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Suggested Courses

752 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