当前记录集不支持更新。这可能是提供程序的限制,也可能是选定锁定类型的限制。 15
<%SetcmdTemp=Server.CreateObject("ADODB.Command")SetInsertCursor=Server.CreateObject(...
<%
Set cmdTemp = Server.CreateObject("ADODB.Command")
Set InsertCursor = Server.CreateObject("ADODB.Recordset")
cmdTemp.CommandText = "SELECT top 1 * FROM orders order by id desc"
cmdTemp.CommandType = 1
Set cmdTemp.ActiveConnection = conn
InsertCursor.Open cmdTemp, , 3, 3
InsertCursor.addnew
if session("user_name")<>"" then
InsertCursor("user_id") =session("user_name")
else
InsertCursor("user_id") ="非会员"
end if
InsertCursor("customerName") =Request("customerName")
InsertCursor("address") =Request("address")
InsertCursor("code") =Request("code")
InsertCursor("phone") =Request("phone")
InsertCursor("email") =Request("email")
InsertCursor("payment") =Request("payment")
InsertCursor("remark") =Request("remark")
InsertCursor.update
InsertCursor.close
sql="select top 1 * from orders order by id desc"
set rs=conn.execute (sql)
if rs.eof or err then
response.write "数据库操作失败,请<a href='Javascript:window.history.go(-1)'>返回</a>"
response.End
else
orderID=rs("id")
end if
set InsertCursor=nothing
productList=session("productList")
If Len(productList) <>0 Then
quantityArray = Split(session("quantityList"), ", ")
productArray = Split(session("productList"), ", ")
for i=0 to UBound(productArray)
set rs=server.createobject("adodb.recordset")
sql = "Select * From hw where g_id="&productArray(i)
rs.open sql,conn,1,1
if Not rs.EOF or err then
If quantity <= 0 Then quantity = 1
sql = "INSERT INTO orderDetail (orderID, productID, productName, price,quantity) "
sql = sql & "VALUES( "& orderID & ","
sql = sql & productArray(i) &",'"
sql = sql & rs("g_name")& "','"
sql = sql & rs("g_cash")& "',"
sql = sql & quantity&")"
' response.write sql
Conn.Execute(sql)
sql="update goods set g_buys=g_buys+1 where g_id="&productArray(i)
conn.execute (sql)
end if
next
end if
%> 展开
Set cmdTemp = Server.CreateObject("ADODB.Command")
Set InsertCursor = Server.CreateObject("ADODB.Recordset")
cmdTemp.CommandText = "SELECT top 1 * FROM orders order by id desc"
cmdTemp.CommandType = 1
Set cmdTemp.ActiveConnection = conn
InsertCursor.Open cmdTemp, , 3, 3
InsertCursor.addnew
if session("user_name")<>"" then
InsertCursor("user_id") =session("user_name")
else
InsertCursor("user_id") ="非会员"
end if
InsertCursor("customerName") =Request("customerName")
InsertCursor("address") =Request("address")
InsertCursor("code") =Request("code")
InsertCursor("phone") =Request("phone")
InsertCursor("email") =Request("email")
InsertCursor("payment") =Request("payment")
InsertCursor("remark") =Request("remark")
InsertCursor.update
InsertCursor.close
sql="select top 1 * from orders order by id desc"
set rs=conn.execute (sql)
if rs.eof or err then
response.write "数据库操作失败,请<a href='Javascript:window.history.go(-1)'>返回</a>"
response.End
else
orderID=rs("id")
end if
set InsertCursor=nothing
productList=session("productList")
If Len(productList) <>0 Then
quantityArray = Split(session("quantityList"), ", ")
productArray = Split(session("productList"), ", ")
for i=0 to UBound(productArray)
set rs=server.createobject("adodb.recordset")
sql = "Select * From hw where g_id="&productArray(i)
rs.open sql,conn,1,1
if Not rs.EOF or err then
If quantity <= 0 Then quantity = 1
sql = "INSERT INTO orderDetail (orderID, productID, productName, price,quantity) "
sql = sql & "VALUES( "& orderID & ","
sql = sql & productArray(i) &",'"
sql = sql & rs("g_name")& "','"
sql = sql & rs("g_cash")& "',"
sql = sql & quantity&")"
' response.write sql
Conn.Execute(sql)
sql="update goods set g_buys=g_buys+1 where g_id="&productArray(i)
conn.execute (sql)
end if
next
end if
%> 展开
1个回答
壹寰(深圳)科技文化有限公司
2021-03-27 广告
2021-03-27 广告
要找正规专业的公司,行业口碑也比较重要。更多详尽准确的信息可以找壹寰(深圳)科技文化有限公司。91数据恢复是壹寰(深圳)科技文化有限公司旗下专业数据恢复品牌,91数据恢复专注于勒索病毒数据恢复、勒索病毒数据修复、数据库修复、数据库解密恢复、...
点击进入详情页
本回答由壹寰(深圳)科技文化有限公司提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询