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

I am doing some twitter authentication in classic asp (I know, but I can't
Some e-Marketing tools claim to choose which web page to display based on where
I have been using the fantastic jQuery library for quite some time and have
Folks, I've been writing some code in Scala lately to teach myself the language
I'm learning to use the fantastic enlive library to do some web-scraping. I need
In reading up on ASP.NET MVC I came across some wonderful examples of validation
Possible Duplicate: WPF MessageBox window style For some reason the MessageBox that comes with
I asked a question on here earlier and got some fantastic responses. I've since
We've been using libxml-ruby for a couple of years. It is fantastic on files
I use a webfont to display some icons on a website. This is fantastic

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.