Help me understand why this is happening!
I use the ADODB.Command object. The Command Text is set to the Stored Procedure Name.
Sometimes, if I DON'T add brackets around the stored procedure name, I get a Syntax Error or Access Violation error.
Sometimes, if I DO add brackets around the stored procedure name, I get a Syntax Error or Access Violation error.
Code:
Dim objCmd As New ADODB.Command
With objCmd
.ActiveConnection = DBConnect()
.CommandText = "MyInsert"
.CommandType = adCmdStoredProc
.Parameters.Append
.CreateParameter("@MyId", adVarChar, adParamInput, 25, "123ABC")
.Execute , , adExecuteNoRecords
End With
Set objCmd = Nothing