下面这些代码如何才能让数据库里的ID自动增加
<%@ codepage="936"%><%Session.CodePage=936%>
<!--#include file="Database/Database.asp"-->
<html>
<HEAD>
<TITLE> 每日咨询添加 </TITLE>
</HEAD>
<BODY>
<%
if request("action")="AddShouRu" then
if trim(request("LineName"))="" then
db.close
set db=nothing
response.write "<SCRIPT language=JavaScript>alert('保存收入信息失败');this.location.href='OrderEdit.asp?bookID="&request("bookID")&"';</SCRIPT>"
else
dim str
str="Insert Into ShouRu(bookID,LineName,KuanXiang,Price,Method,Stime,State,OP,AddTime) Values('"&request("bookID")&"','"&trim(request("LineName"))&"','"&trim(request("KuanXiang"))&"','"&trim(request("Price"))&"','"&trim(request("Method"))&"','"&trim(request("Stime"))&"','待审核','"&trim(request("OP"))&"','"&now()&"')"
db.execute(str)
db.close
set db=nothing
response.write "<SCRIPT language=JavaScript>alert('保存收入信息成功');this.location.href='OrderEdit.asp?bookID="&request("bookID")&"';</SCRIPT>"
end if
else if request("action")="ChangeState" then
Set rsBKprice=Server.CreateObject("ADODB.Recordset")
strBKprice="select * from booking where bookID='"&request("bookID")&"'"
set rsBKprice=db.Execute(strBKprice)
Received=Clng(rsBKprice("Received"))+Clng(trim(request("Price")))
str1="Update booking set Received='"&Received&"' where bookID='"&request("bookID")&"'"
db.execute(str1)
str="Update ShouRu set State='"&trim(request("StateNR"))&"' where id='"&request("id")&"'"
db.execute(str)
rsBKprice.close
set rsBKprice=nothing
db.close
set db=nothing
response.write "<SCRIPT language=JavaScript>alert('审核通过成功');this.location.href='OrderEdit.asp?bookID="&request("bookID")&"';</SCRIPT>"
else if request("action")="Change" then
str="Update ShouRu set KuanXiang='"&trim(request("KuanXiang"))&"',Price='"&trim(request("Price"))&"',Method='"&trim(request("Method"))&"',Stime='"&trim(request("Stime"))&"' where id='"&request("id")&"'"
db.execute(str)
db.close
set db=nothing
response.write "<SCRIPT language=JavaScript>alert('修改成功');this.location.href='OrderEdit.asp?bookID="&request("bookID")&"';</SCRIPT>"
else if request("action")="Delete" then
if request("State")<>"dsh" then
Set rsBKprice=Server.CreateObject("ADODB.Recordset")
strBKprice="select * from booking where bookID='"&request("bookID")&"'"
set rsBKprice=db.Execute(strBKprice)
Received=Clng(rsBKprice("Received"))-Clng(trim(request("Price")))
str1="Update booking set Received='"&Received&"' where bookID='"&request("bookID")&"'"
db.execute(str1)
end if
str="delete from ShouRu where id="&request("id")
db.Execute(str)
db.close
set db=nothing
response.write "<SCRIPT language=JavaScript>alert('删除成功');this.location.href='OrderEdit.asp?bookID="&request("bookID")&"';</SCRIPT>"
end if
end if
end if
end if
%>
</BODY>
</HTML>