| 网站首页 | 业界新闻 | 群组 | 交易 | 人才 | 下载频道 | 博客 | 代码贴 | 编程论坛
共有 547 人关注过本帖
标题:下面这些代码如何才能让数据库里的ID自动增加
只看楼主 加入收藏
asp68
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2017-5-20
  问题点数:0  回复次数:0   
下面这些代码如何才能让数据库里的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>
2017-05-20 22:40







关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.018923 second(s), 9 queries.
Copyright©2004-2018, BCCN.NET, All Rights Reserved