Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7514747
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T00:35:44+00:00 2026-05-30T00:35:44+00:00

My classic ASP page thorws up an error when I pass 2 paremeters to

  • 0

My classic ASP page thorws up an error when I pass 2 paremeters to the Exec code for my
stored procedure. Basically I want to send 1 paremeter to cover the column I am looking for
and one for the search-term. For example imSchool, New York University. I have data checks on the data sent as well as Record Set.State code showing that everytime i choose SQL Query with the two paramerts the error “Operation is not allowed when the object is closed.” always shows.
I tried to open the object at ” While Not rs.EOF” line of code where it error out bit no luck.
I am thinking my SQLQuery is bad because when I run the Stored Procedure in MSSQL with the same input I get a return table everytime. SQL Server 2008 R2 and Classic ASP.

HERE IS MY IF STATMENT WITH SQLQUERY CODE (keep in mind the 1st one works fine and data is selected from the DB)

    SQLQuery = "Exec sp_vw_InternImport"

    Set rs = Server.CreateObject("ADODB.Recordset")
    rs.CursorType = 3

    rs.Open SQLQuery, OBJdbConnection


    If filterColmn <> "" Then

    SQlQuery = "Exec sp_vw_InternImport_ColID @LookUpID=N'" + filterID + "'" + ", @LookUpCol=N'" + filterID + "'"

    Set rs = Server.CreateObject("ADODB.Recordset")
    rs.CursorType = 3

    rs.Open SQLQuery, OBJdbConnection

    End If

HERE IS MY STORED PROCEDURE CODE

          SET ANSI_NULLS ON
            GO
            SET QUOTED_IDENTIFIER ON
             GO

           ALTER PROCEDURE [dbo].[sp_vw_InternImport_ColID]
            (
            @LookUpID nvarchar (255),
            @LookUpCol nvarchar (50)
            )

          AS 
       SET NOCOUNT ON
       BEGIN 

        IF @LookUpCol = 'imYear'
        SELECT * FROM v_InternImport WHERE imYear = @LookUpID

ELSE
IF @LookUpCol = 'imSchool'
SELECT * FROM v_InternImport WHERE imSchool = @LookUpID

ELSE
IF @LookUpCol = 'imDiscipline'
SELECT * FROM v_InternImport WHERE imDiscipline = @LookUpID

       IF @LookUpCol = 'imDegree'
       SELECT * FROM v_InternImport WHERE imDegree = @LookUpID
       END
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T00:35:47+00:00Added an answer on May 30, 2026 at 12:35 am

    When passing arguments to stored procedure directly, you don’t have to “assign” the parameters. Doing this probably results in the whole value passed (e.g. @LookUpCol will have the value of @LookUpCol ='imYear') thus your SP won’t select anything and you have empty and closed recordset.

    Try having such code instead:

    SQlQuery = "Exec sp_vw_InternImport_ColID '" & filterID & "', '" & filterID & "'"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been struggling all day calling a Stored Procedure from a classic ASP page.
So I have visual basic code in a classic asp page where I want
i'm placing a automatic redirect on my Classic ASP page (vb). i want to
If I have the following jscript code on a classic asp page, how do
NET and VB.net code behind. I have a classic ASP page that connects to
I have a login page written in classic asp. I want to set the
When my classic asp page gets to this line of code Dim cnn As
I have a classic ASP page with some code to check if an email
I have some code on a classic ASP page that is attempting to get
I have a Classic ASP page that contains the following code to attempt a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.