我正在尝试单击“确定”按钮运行以下存储过程:
Private Sub ok_Click()
Dim objConnection As New ADODB.Connection
Dim objCom As ADODB.Command
Dim provStr As String
Set objCom = New ADODB.Command
objConnection.Provider = "sqloledb"
provStr = "Data Source=Server Name;" & "Initial Catalog=DB NAME;User Id=USERNAME;Password=Password;"
objConnection.Open provStr
With objCom
.ActiveConnection = objConnection
.CommandText = "dbo.ix_spc_planogram_match 74"
.CommandType = adCmdStoredProc
.Execute
End With
End Sub
错误是:未定义用户类型。存储过程在 SQL Server Management Studio 中正确运行。