我有一个简单的 ASP 页面,它应该根据传入的变量删除或插入一行。我有类似的文件可以正常工作,但是这个不工作......即使没有错误并且 response.write 检查工作正常。我什至尝试使用文字值但没有运气。有任何想法吗?这是代码:
<%
dim tid
dim email
dim joinOrUnjoin
tid = UCase(Request.Form("thisID"))
email = UCase(Request.Form("email"))
joinOrUnjoin = UCase(Request.Form("joinOrUnjoin"))
dim objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "Provider=SQLOLEDB;Server=*********;Database=Reports;User Id=**********;Password=***********;"
objConn.mode = 3
objConn.Open
if LCase(joinOrUnjoin) = "join" then
strSQL = "INSERT INTO SSOcomEmailDistribution (ID, Email) VALUES ('" & id & "', '" & email & "')"
Response.write "Join"
else
strSQL = "DELETE From SSOcomEmailDistribution WHERE ID='" & id & "' AND Email='" & email & "'"
Response.write "Unjoin " & id & " " & email
end if
objConn.Execute(strSQL)
objConn.Close()
Response.write " Done"
%>