
Passing a adGuid parameter to a SP...
Everything looks pretty good but I would setup the input parameter to
16 instead of 72 and lose the Trim$(strUserID) (not that the Trim
should matter but just to be safe). Also - if this doesn't work then
create the SQL query in your SQL Analyzer or comparable such as:
EXEC sp_insert_tbl_user
"{BABE746B-6C3C-492A-82D0-5FAF15B09BD3}","1/1/2001","My User"
And see if that works properly. My example of sp_insert_tbl_user
looks like this:
CREATE PROCEDURE dbo.sp_insert_tbl_user
AS
INSERT .tbl_user (
[user_id] ,
create_date ,
description )
VALUES (
GO
Hope this helps you figure it out.
Dan
Quote:
> Does anyone know why I get this error and what should be changed?
> The error is : Syntax error converting from a character string to
> uniqueidentifier.
> Dim cmdADO as ADODB.Command
> Dim strUserId as string
> strUserId = "{B69AE88F-9B92-11D4-B02F-00508BD6A189}"
> Set cmdADO = New ADODB.Command
> With cmdADO
> .ActiveConnection = ActiveConnection
> .CommandType = adCmdStoredProc
> .CommandText = "SD_TEST"
> End With
> Set parADOUserId = New ADODB.Parameter
> adParamInput, 72, Trim$(strUserId))
> cmdADO.Parameters.Append parADOUserId
> With cmdADO
> .Execute
> End With
> Set parADOUserId = Nothing
> Set cmdADO = Nothing
> Tx,
> Kurt