Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Databases
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 12th, 2004, 02:47 PM
Registered User
 
Join Date: Nov 2004
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Please on help recordset can't open

I am begnnier of writing ASP and have following error.
The error message is
"Operation is not allowed when the object is closed."

I guess the record is not yet opened, Could anyone tell me how can I open it?
Sorry for bad English, from HK...
Thank you in advance.

I attach my code as follow:
Dim objRS, objcomm, objparam, strdirector

set objcomm = server.CreateObject ("ADODB.Command")

objcomm.ActiveConnection = strconnect

objcomm.CommandText ="getuserinfo"
objcomm.CommandType = adcmdstoredproc
set objparam = objcomm.CreateParameter ("@pcstyl",adChar,adparaminput,50)

objcomm.Parameters.append objparam

strdirector ="peter"
objcomm.Parameters ("@user") = strdirector

set objrs = objcomm.Execute

set objcomm =nothing
set objparam = nothing

while not objrs.eof
Response.Write objrs ("user") & objrs ("address")
objrs.movenext
wend

objrs.close
set objrs=nothing
Reply With Quote
  #2 (permalink)  
Old November 12th, 2004, 03:07 PM
Registered User
 
Join Date: Nov 2004
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry, I attach the new code as follow. Thank you.

Dim objRS, objcomm, objparam, strdirector

set objcomm = server.CreateObject ("ADODB.Command")

objcomm.ActiveConnection = strconnect

objcomm.CommandText ="getuserinfo"
objcomm.CommandType = adcmdstoredproc
set objparam = objcomm.CreateParameter ("@user",adChar,adparaminput,50)

objcomm.Parameters.append objparam

strdirector ="peter"
objcomm.Parameters ("@user") = strdirector

set objrs = objcomm.Execute

set objcomm =nothing
set objparam = nothing

while not objrs.eof
Response.Write objrs ("user") & objrs ("address")
objrs.movenext
wend

objrs.close
set objrs=nothing


Reply With Quote
  #3 (permalink)  
Old November 15th, 2004, 02:43 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Code:
objcomm.CommandText ="getuserinfo"
objcomm.CommandType = adcmdstoredproc
set objparam = objcomm.CreateParameter ("@user",adChar,adparaminput,50)
strdirector ="peter"
objparam = strdirector
objcomm.Parameters.append objparam
set objrs = objcomm.Execute
This is how it should be. Your code around that place seems to be wrong.

Hope that helps.
Cheers!

_________________________
- Vijay G
Strive for Perfection
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Open document, Open second doc and copy to first justabeginner Word VBA 1 March 7th, 2007 02:47 AM
Clone DAO Recordset into ADO Recordset kamrans74 VB How-To 0 March 6th, 2007 11:57 AM
recordset open error MMJiggy62 Beginning VB 6 2 September 4th, 2006 04:52 PM
ADODB.Recordset (0x800A0CB3)Current Recordset does tks_muthu Classic ASP Databases 0 June 16th, 2005 07:22 AM
Convert ADO recordset to DAO recordset andrew_taft Access 1 May 5th, 2004 02:31 PM



All times are GMT -4. The time now is 07:38 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.