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 742051
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T08:42:12+00:00 2026-05-14T08:42:12+00:00

For some fantastic reason I find myself debugging a problem in a Classic ASP

  • 0

For some fantastic reason I find myself debugging a problem in a Classic ASP page (at least 10 years of my life lost in the last 2 days).

I’m trying to execute a stored procedure which contains some OUT parameters. The problem is that one of the OUT parameters is not being populated when the stored procedure returns. I can execute the stored proc from SQL management studio (this is 2008) and all the values are being set and returned exactly as expected.

declare @inVar1 varchar(255)
declare @inVar2 varchar(255)
declare @outVar1 varchar(255)
declare @outVar2 varchar(255)

SET @inVar2  = 'someValue'

exec theStoredProc @inVar1 , @inVar2 , @outVar1 OUT, @outVar2 OUT

print '@outVar1=' + @outVar1
print '@outVar2=' + @outVar2 

Works great. Fantastic. Perfect. The exact values that I’m expecting are being returned and printed out.

Right, since I’m trying to debug a Classic ASP page I copied the code into a VBScript file to try and narrow down the problem.

Here is what I came up with:

Set Conn = CreateObject("ADODB.Connection")
Conn.Open "xxx"

Set objCommandSec = CreateObject("ADODB.Command")
objCommandSec.ActiveConnection = Conn

objCommandSec.CommandType = 4
objCommandSec.CommandText = "theStoredProc "

objCommandSec.Parameters.Refresh

objCommandSec.Parameters(2) = "someValue"

objCommandSec.Execute

MsgBox(objCommandSec.Parameters(3))

Doesn’t work. Not even a little bit. (Another ten years of my life down the drain) The third parameter is simply NULL – which is what I’m experiencing in the Classic ASP page as well.

Could someone shed some light on this? Am I completely daft for thinking that the classic ASP code would be the same as the VBScript code? I think it’s using the same scripting engine and syntax so I should be ok, but I’m not 100% sure.

The result I’m seeing from my VBScript is the same as I’m seeing in ASP.

  • 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-14T08:42:13+00:00Added an answer on May 14, 2026 at 8:42 am

    Try

    With objCommandSec
     Set .ActiveConnection = Conn
     .CommandType = 4
     .CommandText = "theStoredProc"
     .Parameters.Append .CreateParameter("@inVar1", 200, 1, 255, VALUE1)
     .Parameters.Append .CreateParameter("@inVar2", 200, 1, 255, VALUE2)
     .Parameters.Append .CreateParameter("@outVar1", 200, 2, 255)
     .Parameters.Append .CreateParameter("@outVar2", 200, 2, 255)
    
     .Execute
    
     Response.Write .Parameters(3).Value
    End With 
    

    You should also avoid .Refresh if you know the parameter details as it involves a trip back to the server.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Some e-Marketing tools claim to choose which web page to display based on where
Some web applications, like Google Docs, store data generated by the users. Data that
Some WPF controls (like the Button ) seem to happily consume all the available
Some API returns me XmlCursor pointing on root of XML Document. I need to
Some things look strange to me: What is the distinction between 0.0.0.0, 127.0.0.1, and
Some Eclipse plugins are mandated by your environment. The appropriate source code management plugin,
Some programming languages such as Java and C# include encryption packages in their standard
Some files in our repository are individual to each developer. For example some developers
Some things are easier to implement just by hand (code), but some are easier
Some context upfront: Imagine a 200+ developers company finally setting up a more or

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.