日期:2014-05-16 浏览次数:20979 次
<html>
<body bgcolor="#EBC79E">
<h3>修改图书</h3>
<br><br><br><br>
<%
Dim SqlDatabaseName,SqlPassword,SqlUsername,SqlLocalName,ConnStr,Conn
SqlDatabaseName = "book"
'SQL数据库名
SqlUsername = "admin"
'SQL数据库用户名
SqlPassword = "111111"
'SQL数据库用户密码
SqlLocalName = "(local)"
'SQL主机IP地址(本地可用“127.0.0.1”或“(local)”,非本机请用真实IP)
ConnStr = "Provider = Sqloledb; User ID = " & SqlUsername & "; Password = " & SqlPassword & "; Initial Catalog = " & SqlDatabaseName & "; Data Source = " & SqlLocalName & ";"
Set conn = Server.CreateObject("ADODB.Connection")
conn.open ConnStr
set rs = Server.CreateObject("ADODB.recordset")
'sql="update book set bname='"&request.form("bname")&"',author='"&request.form("author")&"' ,pub_date='"&request.form("pub_date")&"',publish='"&request.form("publish")&"',price='"&request.form("price")&"' ,state='"&request.form("state")&"',family='"&request.form("family")&"',location='"&request.form("location")&"' where bno='"&request.form("bno")&"'"
Response.write(request.form("bname") )
sql = "update book set bname='" & request.form("banme") & "' where bno='" & request.form("bno") & "'"
'sql = "update book set bname='3a2b',author='3a2b' where bno='1'"
rs.open sql,conn,1,3
%>
<br>
<%=request.form("bname")%>
修改成功
<%
conn.close
%>
</body>
</html>