下面是我用来向 SQL Server 数据库插入一些数据的简单 asp 代码。它给出了以下错误。有人可以看看,让我知道这段代码的错误吗?
<html>
<head>
<title>Address Book Insertion</title>
</head>
<body>
<%
set connection=Server.CreateObject("ADODB.Connection")
connection.Open "Provider=SQLOLEDB;Server=charithj-pc;Integrated Security=SSPI;Initial Catalog=AddressDB;"
cmd = "INSERT INTO AddressBook (FirstName, Surname, Address) VALUES ('"
cmd = cmd & Request("FirstName") & "','"
cmd = cmd & Request("Surname") & "','"
cmd = cmd & Request("Address") & "')"
Response.Write(cmd)
on error resume next
connection.Execute cmd
if err <> 0 then
Response.Write("Insertion failed")
else
Response.Write("Insertion successful")
end if
connection.close
%>
</body>
</html>
网站无法显示页面
HTTP 500
最可能的原因:
•网站正在维护中。
•该网站有一个编程错误。