Microsoft SQL Server
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft SQL Server

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old March 25th, 2003, 12:17 AM
ljhopkins ljhopkins is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 1 ljhopkins User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
stored proc problem

I have a stored proc on a sql 6.5 svr. that run fines from the SQL anlizer, and in VB6 code.<br><br>However when I run it from asp it blows up. saying that cant <br>ADODB.Recordset error '800a0e78' <br><br>Operation is not allowed when the object is closed. <br><br>/prod_ol_rpt/Prod_asp/storedp.asp, line 29 <br><br>this is my code<br><br><%@ Language=VBScript %><br><br><br><!-- #include file="../../scripts/adovbs.inc" ---><br><!-- #include file="common.asp" ---><br><%<br>Dim cmd, rs, connect, intNumber, strConnect, strx<br>'dim strtempname, strtempusername, strtemppassword, strtempdbname strtempcon<br>dim cnFiltered<br><br><br><br>strTempName = "svrhou04"<br>strTempuserName = "pqm"<br>strTempPassword = "pqm"<br>strTempDBName = "MITRON"<br>Connect = "Provider=SQLOLEDB;Server=" & strTempName & ";User ID=" & strTempuserName & ";Password=" & strTempPassword & ";Database=" & strTempDBName & ";"<br><br><br><br>Set cmd = server.CreateObject("ADODB.Connection")<br> cmd.open connect<br> set rs = server.CreateObject("ADODB.recordset")<br> <br> rs.open "EXEC rawdatatemp 1048053600, 1048226398", cmd, adlockoptimistic<br> response.write rs.state<br> response.write cmd.state<br> <br> response.write rs.recordcount<br>do while not rs.eof<br>response.write rs(1)<br>cmd.movenext<br>loop<br><br>%><br> <img border="0" src="/forum/emoticons/devil.gif" height="15" width="15" alt="devil" /> <img border="0" src="/forum/emoticons/devil.gif" height="15" width="15" alt="devil" /> [/code]

Reply With Quote
  #2  
Old March 27th, 2003, 08:27 PM
Andrew Andrew is offline
dotNetBB Forums Developer
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 265 Andrew User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via ICQ to Andrew Send a message via AIM to Andrew Send a message via Yahoo to Andrew
You can't pass SQL statement like that in ASP. Try this...<br><br>Set cmd = server.CreateObject("ADODB.Connection")<br>cmd.CommandText = "rawdatatemp"<br>cmd.CommandType = 4 '-- stored proc<br>cmd("@Param1") = 1048053600 '-- change @Param1 to the actual parameter name<br>cmd("@Param2") = 1048226398 '-- change @Param2 to the actual parameter name<br>cmd.open connect<br><br>set rs = server.CreateObject("ADODB.recordset")<br>set rs = cmd.Execute<p><hr size="1" width="50%" align="left" />dotNetBB Forum Developer<br><b><i>Building A Better Community, One Post At A Time</i></b><br><a href="http://www.dotnetbb.com" target="_blank">www.dotnetbb.com</a></p>

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft SQL Server > stored proc problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway