CREATE PROCEDURE [sp_Seekerinfo]
As
Begin
declare @LastUpdateDate varchar(50)
declare @GetSearch Nvarchar(600)
declare @s Nvarchar(1000)
set @s = 'SELECT Top 1000 seekerID,trueName,gender,age,MaxEduLevel,maxEduSchool,maxEduCourse,WorkPos,LastUpdateDate FROM v_seekerInfo WHERE isvalid = 1 '+@GetSearch+' GROUP BY seekerID,trueName,gender,age,MaxEduLevel,maxEduSchool,maxEduCourse,WorkPos,LastUpdateDate order by '+@LastUpdateDate+' desc'
Exec(@s)
exec sp_executesql @s
End
GO
听各位忠告已经做了储存过程,不过不知道怎么调用,老出错
调用代码:
<!--#include file="common/conn.asp" -->
<% Set cmd = Server.CreateObject("Adodb.Command")
Set Rs_Category = Server.CreateObject("Adodb.Recordset")
strCause=" and ( MaxEduLevel >= 20 AND MaxEduLevel <= 70) AND (age >= 18 AND age <= 60) AND abs(DateDiff(d,Getdate(),LastUpdateDate))<=90 "
cmd.ActiveConnection = dbconn
cmd.CommandText = "sp_Seekerinfo"
cmd.CommandType = &H0004
cmd("@LastUpdateDate")="LastUpdateDate"
cmd("@GetSearch") = strCause
Set Rs_Category = cmd.Execute()
While Not Rs_Category.Eof
Response.Write(Rs_Category("trueName")&"<br>")
Wend
Set Rs_Category = Nothing
Set Cmd = Nothing %>
ADODB.Command 错误 '800a0cc1'
在对应所需名称或序数的集合中,未找到项目。
/****.asp,行 8