标题:下面这些代码如何才能让数据库里的ID自动增加
只看楼主
asp68
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2017-5-20
 问题点数:0 回复次数:1 
下面这些代码如何才能让数据库里的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>
搜索更多相关主题的帖子: if request trim db set 
2017-05-20 22:40
ke爱的小tu子
Rank: 2
等 级:论坛游民
帖 子:51
专家分:20
注 册:2021-2-11
得分:0 
大哥,能不能按几个tab键啊,end if end if看得头都晕了。
2021-02-11 13:57



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-477193-1-1.html




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

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