Wrox Programmer Forums
|
VB Databases Basics Beginning-level VB coding questions specific to using VB with databases. Issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB Databases Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 12th, 2006, 03:39 AM
Registered User
 
Join Date: Dec 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default help me!!!

I am getting the following error while trying to read a recordset:


ADODB.Recordset(0X800A0E78)Operation is not allowed when the object is

closed.
The error happens in the following line after I execute a stored

procedure in SQLSERVER 7:

set rs=Server.CreateObject("ADODB.Recordset")
set cn=Server.CreateObject("ADODB.Connection")
set cmd=Server.CreateObject("ADODB.Command")

cn.connectionstring ="..."
cn.open

cmd.ActiveConnection=cn
cmd.CommandText="getXMLdata"
cmd.CommandType=4

word=CStr(Request.Form("txt1"))
rs.nocount=on
rs.Open "Exec getXMLdata'" & word &"'",cn

While Not rs.EOF <---------line of error!!!!!!
response.Write(rs(0) & "<br>")
rs.MoveNext
wend

rs.close
set rs=nothing


I do not know how to debug this problem.

Please help!!!!

arathy
 
Old December 12th, 2006, 08:43 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

hi there.. you are not opening a recordset, you are executing a SP inside the open of a recordset.. if you want to get the returning recordset, betteg use the execute of the connection.

HTH

Gonzalo









Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.