473,597 Members | 2,726 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

asp page gets an empty recordset from a sql server store procedure

3 New Member
Hello everyone,
I have a web application written in asp 6.0, my problem is that I execute a sql server store procedure and I get an empty recordset, while executing the same sp on query anlyzer I can see 5 records.
Basically the sp create a temp table, populate it, and lastly selects the results from the temp table.
I read on a preceding post to insert the clause: "SET NOCOUNT ON" to avoid getting closed recordset of the insert statements, so I did it.
The query analyzer results changed, (I didn't see the number of rows created any more) But it didn't change the result on the asp page: I still get an empty recordset.
the snippet asp code is the following:
Expand|Select|Wrap|Line Numbers
  1.    dim cmd 
  2.    dim rs
  3.  
  4.    set cmd = server.createobject("adodb.command")
  5.    set rs = server.CreateObject("adodb.recordset")
  6.  
  7.    cmd.commandtext = "mywonderfulstoreprocedure"
  8.    cmd.commandtype = adcmdstoredproc
  9.    cmd.activeconnection = cnapp 'assume that's a succesful connection
  10.  
  11.    cmd.Parameters("@month") = 3
  12.    cmd.Parameters("@year") = 2007
  13.  
  14.    rs.open cmd
  15.    if rs.EOF then
  16.  
  17.         Response.Write "recordset empty"
  18.    else
  19.         Response.Write "recordset full of stuff"
  20.    end if
  21.  
Eventually it's important to point out that the same code arranged for visual basic 6.0 works perfectly, giving back the recordset full of data

Thank you for your help in advance,
Gianni
Nov 14 '07 #1
4 2579
ipez75
3 New Member
I forgot to say that we use windows 2000 Service Pack 4.
Any help would be very appreciated!
Nov 15 '07 #2
jhardman
3,406 Recognized Expert Specialist
Hello everyone,
I have a web application written in asp 6.0,
There is no ASP 6.0. It only got up to 3.0 before M$ abandoned it.

Do you have some sort of error handler running?

Jared
Nov 17 '07 #3
ipez75
3 New Member
Hi,
thank you for your help.
You are absolutely right, it's asp 3.0
As for error handler I test with
if err.number <> 0 then ...
but this test is not passed.

The test passed is rs.EOF, that comes true (I don't know why)

Thank you again.
Gianni
Nov 19 '07 #4
jhardman
3,406 Recognized Expert Specialist
Gianni,

I personally don't like to use stored procedures, I prefer to do the programming in the script and just send very basic queries to the db, but I'll try to help.

if you take out the 'on error' line what error do you get?

Jared
Nov 19 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

9
2290
by: Phil W | last post by:
Hi all, Am having a bit of trouble with the @@identity field - I probably just have that friday feeling and am missing off something obvious, but the below code brings back am empty identity value ("sid" appears empty). I've definitely set up an identity field in the tblSurvey: set rsAdd = Server.CreateObject("ADODB.Recordset") rsAdd.open "tblSurvey", conn, 3 , 3 rsAdd.AddNew
3
2775
by: Ed Burns | last post by:
Hi. I am trying to disable a user from going back to a previous page and displaying information previously shown. I want to give them the typical "Page has Expired" warning message. I am using Win Server 2003. Does anyone know what you have to do so that the user can only see the page once and not to be able to click back and see a cached page. Thanks! Ed
3
1716
by: Steven Scaife | last post by:
I have a search page with upteen boxes that they can choose to fill out and my second page gets the values and passes them to a stored procedure which builds the SQL string and returns the recordset. On this second page i have it so that when a long search is taking place a layer is shown saying "Search in progress .... Please wait". However since i changed to a stored procedure it takes a length of time before the page submits by which...
1
2070
by: tabonni | last post by:
Hi All I connected MS Exchange Server to MS Access database using Access link table function. I can open the database table and see the fields and data inside the link table. However, the table seems cannot be queried by SQL statement. My situation is: I'm building an intranet. I have a ASP login page for all staff in the company to login. Other people can't register or login the intranet.
6
2693
by: Rod Snyder | last post by:
I'm trying to set up an asp.net (vb.net) that will allow a user to insert/update a bio/profile. I wanted to create a SQL Server 2000 table that includes their contact info and bio info. However, I'm not getting SQL Server to accept more than about two paragraphs of info. I've tried the datatypes of ntext and nvar char to no success. I'm presuming most people will be cutting and pasting from a Word document also. Does anyone have any...
5
2768
by: tshad | last post by:
Is there a way to carry data that I have already read from the datagrid from page to page? I am looking at my Datagrid that I page through and when the user says get the next page, I have to go to the database to get the next page. Is there a way to use the dataset to allow us to read back and forth in it instead of going back to the database to get it? Thanks,
4
6702
by: Jack | last post by:
Hi, I am trying to run an example code from a book. However I am getting the following error message: Number: -2147217900 Description: Syntax error or access violation Source: Microsoft OLE DB Provider for SQL Server SQLState: 42000
6
4858
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of the html page controls the form fields that are required. It doesn't function like it's supposed to and I can leave all the fields blank and it still submits the form. Also I can't get it to transfer the file in the upload section. The file name...
8
1768
by: cyberdawg999 | last post by:
hello all every time my page loads it inserts a empty record into my database and when a new record gets inserted a blank record gets inserted and on the next page load and submit the previous record gets inserted. if anyone can help please respond cracking my head over this I know its going to be a stupid or small thing I over looked here is my code:
0
7979
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7894
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8281
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8046
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6706
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5847
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3893
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1497
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1245
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.