我有一个带有参数但不返回任何内容的存储过程。如何从 MS Access 中调用它?
编辑 - 在 Remou 的帮助下,我已经开始工作了:
Set cnn = New adodb.Connection
cnn.ConnectionString =
"driver=SQL Server;server=SERVER\SERVER;database=a_db;Trusted_Connection=Yes"
cnn.Open cnn.ConnectionString
Set cmd = New adodb.Command
cmd.ActiveConnection = cnn
cmd.CommandType = adCmdStoredProc
cmd.CommandText = "stprMoveDataSet"
Set param = cmd.CreateParameter
("DataSetID", adInteger, adParamInput, 6, stDataSet)
cmd.Parameters.Append param
Set param = cmd.CreateParameter
("Destination", adChar, adParamInput, 2, stDestination)
cmd.Parameters.Append param
rs.CursorType = adOpenStatic
rs.CursorLocation = adUseClient
rs.LockType = adLockOptimistic
rs.Open cmd