請首先設置好GConnection和GCommandGCommand.ActiveConnection = GConnection
With GCommand
        .CommandType = adCmdStoredProc
        .CommandText = "存儲過程名"
        .Parameters(1).Direction = adParamOutput'2個輸出參數
        .Parameters(2).Direction = adParamOutput
        .Parameters(3).Value = Action           '3個輸入參數
        .Parameters(4).Value = Layer
        .Parameters(5).Value = Attrition
        .execute
End WithErrnum = GCommand.Parameters(1).Value  '得到返回參數
Errmsg = GCommand.Parameters(2).Value