Stored procedure This article used not to use the Adodb.command command, but simply did a adodb.recordset to execute the stored procedure.
Stored procedures:
' Establish Dbo.tse stored procedures in SQL
CREATE PROCEDURE [dbo]. [TSE]
@keyword varchar (=null), ' Define the keyword for the query
@choose int=null ' defines the type of query (1 is the query column title, others are content)
As
If @choose =1
SELECT * from Web where title like @keyword + '% '
Else
SELECT * from web where content like @keyword + '% '
Return
Go
' List.asp page
<!--#include file= "Conn.inc"-->
<%
Dim rs
Dim sql
Dim keyword
Dim Choose
Keyword=request ("keyword") ' receives page transfer value
Choose=request ("choose")
Set Rs=server.createobject ("Adodb.recordset")
Sql= "Exec tse '" &keyword& "", "&choose&" "' Executes TSE stored procedure with exec, passes the keyword,choose to stored procedure parameters
Rs.Open sql,conn,1,1
If rs.eof and Rs.bof then
Response.Write ("no record!") ")
Response.End
End If
Response.Write "Search for records as follows:<br><br>"
Do Until rs.eof
Response.Write "" &rs ("id") & ":" &rs ("title") & "" ' Print out the ID and title of the article
Response.Write "<br><br>"
Rs.movenext
Loop
' Sweep the battlefield.
Rs.close
Conn.close
Set rs=nothing
Set conn = Nothing
%>