Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/spring-mvc/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp classic 经典ASP从href执行存储过程_Asp Classic - Fatal编程技术网

Asp classic 经典ASP从href执行存储过程

Asp classic 经典ASP从href执行存储过程,asp-classic,Asp Classic,我有一个index.asp页面,显示SQL 2005数据库中的数据。在该索引页上,我有一个用户已经在下拉菜单中选择的课程。我想打开一个新页面test-results.asp,通过单击课程标题显示他们参加的实际考试。我的存储过程spGetCourseResultsByID使用以下参数@MedLicID、@TestID检索数据。我不知道该怎么做。我以前从未支持过经典的asp 这有点宽泛,因为我们对链接或存储过程一无所知 使用request.querystring检索链接参数的值(如果有)。 二,。

我有一个index.asp页面,显示SQL 2005数据库中的数据。在该索引页上,我有一个用户已经在下拉菜单中选择的课程。我想打开一个新页面test-results.asp,通过单击课程标题显示他们参加的实际考试。我的存储过程spGetCourseResultsByID使用以下参数@MedLicID、@TestID检索数据。我不知道该怎么做。我以前从未支持过经典的asp

这有点宽泛,因为我们对链接或存储过程一无所知

使用request.querystring检索链接参数的值(如果有)。 二,。 使用ADO命令对象将参数传递给存储过程 下面是一个示例,但需要针对实际存储过程对其进行修改

 Function GetTest()
    Dim cmd, cn
    Set cmd = Server.CreateObject("ADODB.Command")
    Set cmd.ActiveConnection = dbconn
    With cmd
        .CommandText = "spGetCourseResultsByID"
        .Parameters.Append  .CreateParameter("@RETURN_VALUE", adInteger, adParamReturnValue)
        .Parameters.Append  .CreateParameter("@MedLicID", adVarChar, adParamInput,50,MedLic_ID)
        .Parameters.Append  .CreateParameter("@TestID", adVarChar, adParamInput,50,Test_ID)
        .execute
        strResponse = Cint(.Parameters(0).value )
    End With
    With Response
        if strResponse > 0 then
            .Write strSuccess
        else
            .Write strFailure
        end if
    End With
End Function