|
Stored
Procedure
<@ Language=VBScript %>
<% Option Explicit %>
<html>
<head>
</head>
<body>
<%
Dim conn
Dim SQL
Dim R
Dim F
Dim RecsAffected
Dim aConnectionString
Dim cm
Dim param
aConnectionString = "Provider=SQLOLEDB;Data " &
"Source=(local);Database=ClassRecords;" & "UID=sa;PWD=;"
Set conn = Server.Create0bject("ADODB.Connection")
conn.Mode = adModeRead
conn.ConnectionString = aConnectionString
conn.CursorLocation = adUseClient
Set cm = Server.Create0bject("ADODB.Command")
cm.ActiveConnection = conn
Set param = cm.CreateParameter("StudentID", adInteger,
adParamInput, 4, 7)
cm.Parameters.Append param
Response.Write cm.Parameters.Count
cm.CommandText = "getStudentName"
cm.CommandType = adCmdStoredProc
conn.open
Set R = cm.Execute (RecsAffected, 7, adCmdStoredProc)
If Not R.EOF Then
For Each F In R.fields
Response.Write F.Name & "=" & F.Value &
"<br>"
Next
End If
R.close
Set R = Nothing
conn.Close
Set conn = Nothing
%>
</body>
<html>
|