|
在 Access 中使用“存储过程”(3) .ActiveConnection = conn .CommandType = &H0004 '存储过程 .CommandText = "AddNewData" End With
cmd.Execute , Array(CStr(Now()), CSng(s))
With cmd .ActiveConnection = conn .CommandType = &H0004 '存储过程 .CommandText = "GetData" End With
Dim resultRS, resultArray Set resultRS = cmd.Execute(, Null)
If Not resultRS.EOF Then resultArray = resultRS.GetRows() End If
Set resultRS = Nothing Set cmd = Nothing conn.Close Set conn = Nothing
Response.Write "<ul>" Dim i For i = 0 To UBound(resultArray, 2) Response.Write "<li>" & resultArray(0, i) Response.Write " " & resultArray(1, i) Response.Write " " & resultArray(2, i) Response.Write "</li>" Next Response.Write "</ul>" %>
运行结果。

感觉起来,速度似乎很快,呵呵~
不知道这样在 Access 中使用存储过程的意义大不大,不过确实很好玩
ASP 正在没落,不过我仍然很喜欢它的小快灵~
参考资料:
http://aspalliance.com/andrewmooney/default.aspx?article=16
http://support.microsoft.com/default.aspx?scid=kb;EN-US;304352
|