Microsoft
Software
Hardware
Network
Question : Reetrieving SQL data from a store procedure in ASP
Hi,
I am working on a ASP application and finding very difficult to retrieve SQL data from a recordset =(. I was wondering if you could help me with this.
I have a connection declared in global.asa(ADOConnection) which I use for the rest of my queries and works great. My code is as follows:
I receive a string with the store procedures to execute such as this:
Query = "EXEC spDataTranslateBegin INSERT INTO ##tempdata SELECT * FROM [dbo].[DataInf] WHERE ([DateTime] >= '19/07/2010 15:04:41') ORDER BY [ID] DESC EXEC spDataTranslateEnd"
Here the function that execute the query:
**************************
**********
**********
** function **************************
***
Sub Export(Query)
dim Rs
set Rs = server.createobject("ADODB
.recordset
")
Set Rs = ADOConnection.Execute(Quer
y)
if not Rs.eof then
while not Rs.eof
----------------do something with the fields ---------------
Rs.movenext
wend
end if
set Rs=nothing
End Sub
**************************
**********
********* end function **************************
When I want to read the recordset I get the following error:
Error Type:
ADODB.Recordset (0x800A0E78)
Operation is not allowed when the object is closed.
However I know the connection and recordset are fine because if I run the same code but with a simple query such as;
Query = "Select * from DataInf" and it works fine.
It is just when I try to add an store procedure that the object becomes closed even if it is just one simple store procedure =(
I have tried with the command method, execute method and different properties such as adCmdStoredProc and even creating another connection and nothing seems to work =(.
Do you have any suggestion?
Thank you very much for reading my email.
Answer : Reetrieving SQL data from a store procedure in ASP
Hi Donnie - That will probably work as long as you have the additional 4 pin power plug if it is required. In any case it won't hurt to try.
Random Solutions
How to allow/disallow with robots.txt a specific directory
Create Table (MS SQL 2008) with Time Column that accepts 14:00 format only
Install Office Communicator 2007 fails on database
ShellExecute while remaining in process
Block access to a single website - Software Resttriction Policies
Deploy RemoteApp MSI using GPO
Toshiba Satellite randomly shuts off and won't turn on
Getting IIS7 to Show Friendly Error Messages in ASP
Delete rows in each txt file that matches full or partially. Whose names are mentioned in another txt file.
Screen Printing / Art Department Resource Scheduling and Organization