type clash: sql_variant is incompatible with text
How do I create a command object( in VBA) to a Stored Procedure that has a SQL DataType "Text" as one of the arguments
My SP:
CREATE PROCEDURE dbo.Spacs_AddNotes
@Spac_Name VARCHAR(50),
@Dt DATETIME,
@Notes Text
AS
INSERT INTO Spacs_Notes
(name_id, dt, notes)
SELECT N.Name_Id,@Dt,@Notes
FROM Spacs_Names N
WHERE Spac_Name = @Spac_Name
GO
And my VBA Code
Dim notes As ADODB.Parameter
Set notes = cmdDb.CreateParameter("notes", adVariant, adParamInput, , Null)
cmdDb.Parameters.Append notes
cmdDb.Parameters.item(2) = Cells(i, 6).Value
cmdDb.Execute
Cells(i,6) has "text test 123 test" in it in excel.
I get a "Operand type clash: sql_variant is incompatible with text" error.
Thanks!!!
|