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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:12:35+00:00 2026-05-27T03:12:35+00:00

I am developing/maintaining classic asp pages and asp code on a Windows 7 PC

  • 0

I am developing/maintaining classic asp pages and asp code on a Windows 7 PC with data taking from an Sqlserver/Express 2008/R2.

In this code I use a stored procedure to log-on to the web site.

  • If the login-id and password combination is correct some tables are updated using UPDATE or INSERT.

  • If the login-id or password is not correct, no logging is issued( so no tables are updated ).

A result set is returned with some fields on both cases (with a field set to -1 or the internal user nr depending on the correctness of login-id and password).

I have been using this same routine for over 5 years now , running on all sorts of IIS servers and with all sorts of Sqlservers.

The code, which works on other IIS/Sqlservers combinations does not work on my development PC.

Any idea why?

Since it is a development environment I use the sqlserver SA account with the appropriate password. So as far as I can tell, this SA user should have all appropriate rights.

To be complete I will now give the routine ( but you will see it’s very straight forward ):

  function DoLogon( byval psNickName, byval psPassword)

     dim sSql

     DoLogon = False

     psNickName = Trim(psNickName)
     psPassword = Trim(psPassword)

     if (psNickName = "") then exit function
     if (psPassword = "") then exit function

   '  on error Resume Next

     call DbOpen

     sSql = "exec sp_EcomLogon " & SqlString( psNickName ) & "," & _
                              SqlString(psPassWord) & "," & _
                              SqlString(Request.ServerVariables("REMOTE_ADDR")) & "," & _
                              Trim(cStr(Session.SessionId))

     objRec.Open sSql ,objConn  ' ,adOpenStatic,adLockReadOnly ,adCmdText

     Klant_NetId = FldDft("K_NetId",-1)

     Call SetVarValue(cKlant_NetId,Klant_NetId)
     objRec.Close
     call DbClose

     if Klant_NetId <> -1 then
        DoLogon = True
        Klant_IsLoggedOn = 1
     else
        DoLogon = False
        Klant_IsLoggedOn = 0
     end if
     call  SetVarValue(cKlant_IsLoggedOn, Klant_IsLoggedOn)

  end function

The following error is displayed when the objRec.Close line is present:

ADODB.Recordset error '800a0e78'

Operation is not allowed when the object is closed.
  • Replacing the exec sp_... with a select * from ... works. So I presume the code it self is correct.

  • DbOpen and DbClose will allocate objRec and objConn and connect to / disconnect from the server (here SqlServer).

UPDATE AND SOLUTION

I have asked the person providing me with this solution to create an answer so I can give him proper upvotes, but in the mean time I will present the solution here.

As the first statement if the stored procedure I have added

set nocount on

And this seems to be the trick to get it working.

I have not found why this is necessary (from a technically view point), just that including set nocount on will speed up the stored procedures, but at last I have running stored procedures in combination with classic ASP again !

  • 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-27T03:12:36+00:00Added an answer on May 27, 2026 at 3:12 am

    Try to add set nocount on to the top of the stored procedure?

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

Sidebar

Related Questions

This past summer I was developing a basic ASP.NET/SQL Server CRUD app, and unit
Developing a Sencha Touch MVC app that pulls data from json store (thats set
Developing websites are time-consuming. To improve productivity, I would code a prototype to show
Developing server side code i finally got my eyes X-crossed trying to write -
I am developing / maintaining a tool that allows users to run queries against
I am developing a multilingual ASP.NET web site. I want the users to be
I learning Python (coming from a dotnet background) and developing an app which interacts
Developing a multilingual application in VB.Net 2008, Im able to add resources to forms
I am developing and maintaining a .NET 3.5 tool at work, and wondering whether
I'm in charge of developing and maintaining a group of Web Applications that are

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.