I am trying to create a SPROC and then access it via VB6. I am able to create the SPROC by using the following code:

VB Code:
  1. 'Stored Procedure
  2. USE IADATA
  3. DROP PROCEDURE dbo.GetCasesTeam
  4. GO
  5. Create Procedure dbo.GetCasesTeam
  6.     @InvUnit VarChar(100),
  7.     @Team VarChar(100) OutPut,
  8.     @Count int Output
  9.  
  10. As
  11.  
  12.     SELECT @Team = dbo.INCIDENTS.INV_TITLE, @Count = Count(IA_ADM.PRIMARY_CASE_REC.CASENUM)
  13.     FROM dbo.INCIDENTS INNER JOIN IA_ADM.PRIMARY_CASE_REC ON
  14.     dbo.INCIDENTS.INCNUM = IA_ADM.PRIMARY_CASE_REC.PC_INCNUM
  15.     WHERE dbo.INCIDENTS.INV_UNIT in('@InvUnit') AND
  16.     dbo.INCIDENTS.STATUS in('Active','Suspended')
  17.     GROUP BY dbo.INCIDENTS.INV_TITLE
  18.     ORDER BY Count(IA_ADM.PRIMARY_CASE_REC.CASENUM);
  19.  
  20. RETURN @@ERROR

But when I run the following code I get an error on the .Execute Line, "Type name is invalid". WHat am I doing wrong? Also when I try to use adVarChar in the create Parameter property I get an "Parameter Object is improperly define. Incoonsistant or incomplete information was provided" error
VB Code:
  1. 'VB Code
  2. Private Sub Form_Load()
  3.  
  4. Dim adoConn As ADODB.Connection
  5. Dim adoCmd As ADODB.Command
  6.  
  7. Set adoConn = New ADODB.Connection
  8. adoConn.Open connString
  9.  
  10. Set adoCmd = New ADODB.Command
  11. With adoCmd
  12.     Set .ActiveConnection = adoConn
  13.     .CommandText = "GetCasesTeam"
  14.     .CommandType = adCmdStoredProc
  15.     .Parameters.Append .CreateParameter("RetVal", adInteger, adParamReturnValue)
  16.     .Parameters.Append .CreateParameter("InvUnit", adVariant, adParamInput) '<==Error when I use adVarChar
  17.     .Parameters.Append .CreateParameter("Team", adVariant, adParamOutput, 100)
  18.     .Parameters.Append .CreateParameter("Count", adInteger, adParamOutput)
  19.     .Parameters("InvUnit").Value = "Unit A"
  20.  
  21.     .Execute , , adExecuteNoRecords 'the stored procedure does not return any records '<=== Error "Type name is invalid"
  22.  
  23.     Debug.Print .Parameters("Team").Value, .Parameters("Count").Value
  24. End With

End Sub

Thanks!