Solved

Double entries when inserting a new records...

Posted on 2002-07-19
4
165 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

Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Configure IIS to process JSON 10 90
Web server settings related to keepalive 1 126
SSL Certificate for IIS7 Site 2 59
Link failure 16 35
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…
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.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

830 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