Cannot use parentheses when calling a Sub

前端 未结 3 873
南旧
南旧 2021-01-28 02:15

I have a Classic ASP page that contains the following code to attempt a parametised query;

<%
Set cmdEmail = Server.CreateObject(\"ADODB.Command\")
Set rsEmai         


        
3条回答
  •  佛祖请我去吃肉
    2021-01-28 03:18

    set cmdEmail = Server.CreateObject("ADODB.Command")
    

    Try and put some debug statements to check, if it is creating an instance of ADODB.Command.

    e.g.

    If (cmdEmail is Nothing) Then
       Response.Write("could not create the instance")
    Else
       Response.Write("created the instance")
    End If
    

    Also, remove the With block and see if that makes any difference

    dim paramContentID
    
    cmdEmail.CommandText = "SELECT * FROM VWTenantPropertiesResults WHERE ContentID = ?"
    cmdEmail.CommandType = 1
    cmdEmail.ActiveConnection = MM_dbconn_STRING
    
    set paramContentID = cmdEmail.CreateParameter("@ContentID", 3, 1, , request.Form("ContentID"))
    cmdEmail.Parameters.Append paramContentID
    

提交回复
热议问题