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
difference between AD integrated dns server and dns server
windows 7 dual monitor not working
Removing Rootkit.Agent on Windows XP SP3 ComboFix log attached
DNS Search List appending to all nebios / dns names
Install IIS with a vbs script.If supporting files needed pick from a predefined path.
Extract / Create thumbnails (1st page) for office documents using PHP on Windows or Linux/Mac server
Apache webserver Linux and Gzip
Is it possible to encrypt an email message using PHP?
how to capture out parameter from storedProcedure in java
Send two files in email as attachment in unix shell scripting using ksh