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:
  #1  
Old March 25th, 2003, 01: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, 09: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: 7
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





 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

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





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek