title: Calling from classic ASP to a SQL Server stored procedure that has a binary datatype input parameter
body: <p>I have to call a stored procedure in a SQL Server database from classic asp (VBScript)</p>
  
  <p>The problem is that one of the parameters of the stored procedure is of type "binary(1)".
  I have looked at the VBscript data type constants for ADO and it seems that the equivalence for SQL binary types is AdBinary, but I don't know how to deal with this kind of data type from classic ASP. 
  I have tried to set the value but I get wrong type errors. Is it possible in classic ASP to convert a numeric or a string value to binary data? </p>
  
  <p>Invoking the same procedure using a query string like "Exec Procedure..." seems to work just concatenating the value for the binary parameter, but I have no idea of how to do the same using the ADODB.Command object.</p>
  
  <p>Maybe someone have faced this situation before?</p>
  
  <pre class="lang-vb prettyprint-override"><code>Dim bvalue 
  Dim Conn
  Dim objCommand
  Dim RS
  Set Conn = CreateObject("ADODB.Connection")
  Conn.Open CONNECTION_STRING
  Set objCommand = CreateObject("ADODB.Command")
  objCommand.ActiveConnection = Conn
  objCommand.CommandText = "GetBinaryId"
  objCommand.CommandType = adCmdStoredProc
  objCommand.NamedParameters = True
  bvalue = 15
  objCommand.Parameters.Append objCommand.CreateParameter("@Id",adBinary,adParamInput,1,bvalue) 
  
   set RS = objCommand.Execute
  </code></pre>