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

  • Home
  • SEARCH
  • 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 8279551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T09:22:49+00:00 2026-06-08T09:22:49+00:00

Has anyone ever encountered a problem where a SQL query from a classic ASP

  • 0

Has anyone ever encountered a problem where a SQL query from a classic ASP page returns partial results, but no errors?

I have a situation where a particular query on a page (one of many throughout the system) is returning a different number of rows each time it is run, and always less than the “correct” number, as determined by running the SQL against the server directly.

I think this may be related to the connection timeout (since this occurs with a long-running query and my timing shows that it is returning very close to the timeout), but I am receiving no timeout errors. Instead, as far as I can tell, it causes no errors, and returns a valid DataSet which the code then loops over to build the results table.

Since there is no indication that an error has occurred, there is no suggestion that the data is not complete which means that users can no longer trust this report. Generally with this system, where SQL timeouts do occur frequently for “large” queries, we get error messages displayed on the page.

Investigations

  • I’ve check the HTML source to make sure there are no injected error’s that I’m missing and that all tags are well-formed and that expected page elements are present. This indicates it’s not an error writing a particular row from the results.
    ** Furthermore, the number of rows returned is different each time.
  • I’ve verified that the exact same query is being run each time.
  • I’ve verified that the data in the DB is not changin underneath the report (it’s historic and I’ve cross-checked by running the report and the query against the DB at the same time.)
  • I’ve tried to manually print any errors from the query, but get nothing.
  • I’ve tried changing the timeout (though this hasn’t helped as I can only do
    this on the Dev environment and there there is not sufficient data in
    the DB to reach the timeout, due to this issue.).
  • There are only around 20 rows in total expected, so not an issue with a very large dataset.

Has anyone run into a situation where a SQL query from a classic asp page only returns partial results, and is there any way to check for or prevent this condition?

Setup:

  • Classic asp web application
  • Heavy use throughout of ADODB.Connection objects for connecting to the DB2 server backend databases.
  • The database is static as far as the queried data is concerned.

Shared connection initilization as follows:

connString = "Provider=MSDASQL.1;User ID=xxx;Data Source=XXX;Extended Properties=""DSN=XXX;UID=XXX;PWD=XXX;"""
Set conn = Server.CreateObject( "ADODB.Connection" )
Set cmd = Server.CreateObject("ADODB.Command")
conn.Mode = adOpenReadOnly
conn.Open connString
cmd.ActiveConnection = conn
cmd.CommandTimeout = 600

Usage as follows:

query = " SELECT blah FROM Foo WHERE ... " ' big long list of clauses defined from user selections.
cmd.CommandText = sql
Set oRs = cmd.Execute

Resposne.Write "<table>..." ' Write table headers here'
Do while (Not oRs.eof)
     Response.Write "<tr>...</tr>" ' WRite details from oRs here
     oRs.MoveNext
Loop
Response.Write "</table>"
  • 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-06-08T09:22:50+00:00Added an answer on June 8, 2026 at 9:22 am

    Try adding an order by to the query, that way it should send all rows at once and you can rule in or out timeout issues

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

Sidebar

Related Questions

Has anyone ever encountered an issue like this with Flash[as3] in IE8? I've noticed
Has anyone ever run a problem where creating a new STS project in Visual
Has anyone ever used ASP or ASP.NET to connect to HPQC via the API?
Has anyone ever done Google Analytics tracking from a PHP command line program? I
Has anyone ever encountered the InsufficientExecutionStackException ? MSDN doesn't tell much about it. What
Has anyone ever put a page indicator at the top of a gallery? Writing
Has anyone ever encountered a situation where this code doesn't work: $('#whatever').css({ left:'+=7px' });
Has anyone ever used the hidden class PackageParser in Android source code with java
Has anyone ever run into this issue before? Sometimes the string displays, sometimes half
Has anyone ever worked with a system of passing back say, some JSON data

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.