|
ASPPlayground -> RE: RE: Passing parameter to stored procedure (7/9/2002 20:59:38)
|
There are a few things you need to know about Access' s Stored Procedure, and please take the following code as an example: Dim objRS, strSP, strDb, intVar, strVar, arrAllRec
intVar = CInt (request(" integerValue" ))
strVar = CStr (request(" StringValue" ))
strDb = " Northwind" [color=#666600]' Assume that you have a DSN entry called Northwind[/color]
strSP = " spSelectSomething " &intVar&" , ' " &strVar&" ' " [color=#666600]' Don' t wrap parameteres with parentheses, and spSelectSomething is a Stored Query in your Access DB[/color]
set objRS = Server.CreateObject(" ADODB.RECORDSET" )
With objRS
.open strSP, strDb, , , adCmdStoredProc
if not .EOF then
arrAllRec = .getrows
end if
.close
End With
Set objRS = nothing
|
|
|
|