The code looks fine to me.
 
Try a response.write somewhere in your code where you do the insert to make sure that 
it is executing twice.  
 
Mark

Seetha <[EMAIL PROTECTED]> wrote:
Hai all!

I am using the following code for adding a record into the database.

I am giving only one insert command in my coding.

But it is storing two times into the database. I don't know the 
reason for this.

My friends also facing the same problem.  

If anybody knows the reason, plz help me correct it. It is very 
urgent...........

Thanx in advance

Seetha



<html>

<head>
<SCRIPT LANGUAGE=javascript>
function gopage1()
{
document.add.method="post"
document.add.action="userteianentry.asp?FOC=4"
document.add.submit()
}
</SCRIPT>
</head>
<body>
<form name=add>
<!--#include file="Conn.asp"-->
<%

uc=68

set RS=Server.CreateObject("ADODB.Recordset")
sql="SELECT max(teianno) FROM teian WHERE unitcode=" & uc & ""
rs.Open sql,conn

n=rs(0) +1


sql2="insert into teian values(" & uc & "," & n & ")"
conn.execute sql2
%>
<br>
<br>
<br><br><br><br><br><br><br><br>


<center><font face="Trebuchet MS" color=navy><%=oldn%> - <%=n-1%> is 
Updated</font><br>
<input type="image" src="back.jpg" name="image1" onclick="gopage1
()"></center>

<%conn.close
%>

</form>
</body>
</html>







Yahoo! Groups SponsorADVERTISEMENT


---------------------------------
Yahoo! Groups Links

   To visit your group on the web, go to:
http://groups.yahoo.com/group/AspClassicAnyQuestionIsOk/
  
   To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
  
   Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 



[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor --------------------~--> 
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/saFolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspClassicAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to