aspsql7.asp
来自「sql server 2005书中11到16章的全部代码」· ASP 代码 · 共 28 行
ASP
28 行
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>后台处理页面</title>
</head>
<%
set myconn=server.createobject("adodb.connection")
myconn.open "driver={sql server};server=localhost; uid=aspnetname;pwd=123456;database=project "
set mycomm=server.CreateObject("adodb.command")
set mycomm.activeconnection=myconn
mycomm.commandtext="insert into 项目(项目号,预算,开工日期) values (?,?,?)" //插入语句
mycomm.commandtype=1
mycomm.parameters.append mycomm.createparameter("项目号",200,,25)
mycomm.parameters.append mycomm.createparameter("预算",200,,25)
mycomm.parameters.append mycomm.createparameter("开工日期",200,,25)
mycomm("项目号")=request("projectnum")
mycomm("预算")=request("yusuan")
mycomm("开工日期")=request("worktime")
mycomm.execute
set mycomm=nothing
myconn.close
set myconn=nothing
response.write "利用command对象成功插入!"
%>
<body>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?