468,765 Members | 1,299 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,765 developers. It's quick & easy.

Adding Duplicate Record in database

Hi All,

I am having a totaly different sort of problem which is out of my efforts now so may be any one out of you might help me out of this.

I am using very simple code below to add a record in database and it is working, i mean record is being inserted in database

<!--#include file='../include/connection.asp'-->
sql = "insert into tblbuilding (building_name,area_name,city_name,description,lib _status,dated,timed,logby) values ('" & Request.Form("buildingname") &"','" & request.Form("areaname") &"','" & request.Form("cityname") & "','" & descr & "','1','" & date() &"','" & time() & "','" & session("uname")& "')"

conn.execute sql
Msg = "1 Record Added ....... "
Response.redirect ("buildingsnaps.asp?ConfMsg="&Msg)


But the problem is that when this page execute and when page redirect to next page showing the values from same table where i am adding records, but it shows me double enteries with different id. There is no loop in above code but in my point of view page is being executed twice which cause double entry in database but i cant understand how this all is happening...

Kindly respond me soon to get out of this problem...
Sep 20 '07 #1
1 1430
692 Expert 512MB

Hope so you still need this,

Try to debug the code by not redirecting the page "buildingsnaps.asp". Are you doing something on this page because which record is getting inserted twice?

Also, check if you are submitting the page more than once by mistake.
Oct 1 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

6 posts views Thread by 6thirty | last post: by
3 posts views Thread by Jim Heavey | last post: by
6 posts views Thread by planetthoughtful | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by Marin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.