Error:arguments are of the wrong type are out of acceptable range RRS feed

  • Question

  • Got the error when createParameter

               Set objConn = CreateObject("ADODB.Command")
               Set objConn.activeconnection = oConnOutlook
               objConn.CommandTimeout = 60
               objConn.CommandText = "spName"
    	   objConn.CommandType = &H0004
    	  set param1 = objConn.createParameter("data1",  vbvarchar, adParamInput, 20, "a value")
              oCmd.Parameters.Append param1
              set param2 =    oCmd.createParameter("number",  vbString, adParamInput, 20, "123")
     oCmd.Parameters.Append param2
          set rs = objConn.execute

    • Edited by _dson Thursday, April 21, 2016 3:53 AM o
    Thursday, April 21, 2016 3:41 AM


  • Hi, _dson

    According to your description and error, Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another. This error is often caused by a typographical error in an SQL SELECT statement. For example, a misspelled field name or table name can generate this error. This error can also occur when a field or table named in a SELECT statement does not exist in the data store. So I suggest that you could check your store procedure.

    For more information, click here to refer about ADO Error Reference

    In addition you could use a command to call a stored procedure. 

    For more information, click here to refer about Calling a Stored Procedure with a Command

    Friday, April 22, 2016 2:50 AM