Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Aren't you missing the "Set" statement in there?</p> <p>ie:</p> <pre><code>&lt;% Set cmdEmail = Server.CreateObject("ADODB.Command") Set rsEmail = Server.CreateObject("ADODB.Recordset") </code></pre> <p><strong>UPDATE:</strong></p> <p>In response to Neil's comment of:</p> <blockquote> <p>Thanks CraigTP. It seems to be creating the instance of ADODB.Command and ADODB.Recordset, but having issues witht he last 4 lines of the code.</p> </blockquote> <p>I think the last lines of code, should read something like:</p> <pre><code>cmdEmail.CommandText = "SELECT * FROM VWTenantPropertiesResults WHERE ContentID = ?" cmdEmail.CommandType = 1 cmdEmail.ActiveConnection = MM_dbconn_STRING Set adoParam = cmdEmail.CreateParameter("@ContentID", 3, 1, , request.Form("ContentID")) adoParam.Type = [the datatype of the parameter] cmdEmail.Parameters.Append(adoParam) </code></pre> <p>Note that the <code>.CreateParameter</code> method will return a <code>Parameter</code> object. You should assign this returned object to a variable which you then use as a parameter to the <code>.Append</code> method on the <code>Command</code> object's <code>Parameters</code> collection.</p> <p>See these links for more information:</p> <p><a href="http://msdn.microsoft.com/en-us/library/ms677209%28VS.85%29.aspx" rel="nofollow noreferrer">CreateParameter Method (ADO)</a><br> <a href="http://msdn.microsoft.com/en-us/library/ms675869%28VS.85%29.aspx" rel="nofollow noreferrer">Parameters Collection (ADO)</a><br> <a href="http://msdn.microsoft.com/en-us/library/ms681564%28VS.85%29.aspx" rel="nofollow noreferrer">Append Method (ADO)</a> </p> <p>Note the section headed "Remarks Parameters Collection" where it states:</p> <blockquote> <p>You must set the Type property of a Parameter object before appending it to the Parameters collection.</p> </blockquote> <p>The <code>.Type</code> property of the <code>Parameter</code> object takes a value from the <a href="http://msdn.microsoft.com/en-us/library/ms675318%28VS.85%29.aspx" rel="nofollow noreferrer">DataTypeEnum</a> enumeration to specify the data type of the parameter. Replace the <code>[the datatype of the parameter]</code> bit of my code above with the relevant data type enum value.</p> <p><strong>UPDATE 2:</strong></p> <p><em>Sorry, didn't notice the question title text had changed!</em></p> <p>Ah.. The old classic "Cannot use parentheses when calling a Sub" error, eh?</p> <p>Well, this is explained here:</p> <p><a href="http://www.vbscriptonline.com/errors/syntax/Cannot-use-parentheses-when-calling-a-Sub.asp" rel="nofollow noreferrer">Cannot use parentheses when calling a Sub</a> </p> <p>In a nutshell:</p> <blockquote> <p>You invoked a subroutine without the Call statement, but used parentheses (). When calling a subroutine without the Call statement, do not use parentheses.</p> <p>To correct this error:</p> <ul> <li>Remove the parentheses from the subroutine invocation.</li> <li>Use the Call statement to invoke the subroutine instead.</li> </ul> </blockquote> <p>There's also a blog post from Eric Lippert that addresses this common error:</p> <p><a href="http://blogs.msdn.com/ericlippert/archive/2003/09/15/52996.aspx" rel="nofollow noreferrer">What do you mean "cannot use parentheses?"</a> </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload