前提:

sql server2000 创建存储过程:

create procedure dbo.getuserlist
as
set nocount on  //解释//http://www.3389hack.com/xueyuan/fuwuqi/mssql/6129.html
begin
select * from tab_user_reg
end
go 

asp中的vbscript脚本:
<%
Dim Conn,Connstr
Set Conn=Server.CreateObject("ADODB.Connection") '创建名为Conn的Connection对象
Connstr="provider=sqloledb;data source=(local);initial catalog=db_25;user id=sa;password=123456;" '定义连接数据库字符串
Conn.Open Connstr '建立连接
%>
调用方法:
1、通过command对象调用:
<%
dim mycomm,myrst
set mycomm=server.CreateObject("ADODB.command")
mycomm.activeconnection=connstr
mycomm.commandtext="getuserlist"
mycomm.commandtype=4
mycomm.prepared=true
set myrst=mycomm.execute
set mycomm=nothing
%>
2、通过connection对象调用:
<%
dim myconn,myrst
set myconn=server.CreateObject("ADODB.connection")
myconn.open connstr
set myrst=myconn.execute("getuserlist",0,4)
set myconn=nothing
 %>
3、通过recordest对象调用:
<%
dim myrst
set myrst=server.CreateObject("ADODB.recordest")
myrst.open "getuserlist",connstr,0,1,4
%>

在网页中输出内容:

<%= myrst("id") %>
<%= myrst("uname") %>