Re: sp_xml_removedocument can't find handle
From: Michael Rys [MSFT] (mrys_at_online.microsoft.com)
Date: 04/27/04
- Next message: Michael Rys [MSFT]: "Re: xml storage model in yukon"
- Previous message: Michael Rys [MSFT]: "Re: OPENXML Stored Procedure"
- In reply to: Jack Zinn: "sp_xml_removedocument can't find handle"
- Next in thread: Jack Zinn: "Re: sp_xml_removedocument can't find handle"
- Reply: Jack Zinn: "Re: sp_xml_removedocument can't find handle"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 26 Apr 2004 18:44:38 -0700
The handle lives until the connection is reset. Can you write a single
stored proc and call that instead of doing this inside an ASP page by
calling 3 stored procs?
Best regards
Michael
"Jack Zinn" <jzinn@verticalnet.com> wrote in message
news:acd853d3.0404261122.4298a049@posting.google.com...
> We are using an ASP page to create a handle to an XML document via
> sp_xml_preparedocument, then using that XML document to populate data
> within the database, and then removing the document. The code looks
> like this:
>
> ***************************************************************************
> '-- "f" is a file. The document can be large (10K to several MB)
> '-- gsp_create_xml_dom is a cover SP that simply calls
> '-- sp_xml_preparedocument and then returns the handle.
> strSQL = "EXECUTE gsp_create_xml_dom '" & f.ReadAll & "'"
> set rs = conn.execute (strSQL)
>
> XML_DOM = rs("XML_DOM_Handle")
>
> '-- Uses the XML document to populate data
> strSQL = "EXECUTE gsp_populate_data " & XML_DOM
> set rs = conn.execute (strSQL)
>
> '-- Removes the document from memory
> strSQL = "EXECUTE sp_xml_removedocument " & XML_DOM
> set rs = conn.execute (strSQL)
> ***************************************************************************
>
> When we run it, we get the following error message:
> Microsoft OLE DB Provider for SQL Server error '80040e14'
>
> Could not find prepared statement with handle 1.
>
> One odd thing is that it ALWAYS returns the handle of 1 (i.e., XML_DOM
> == 1). Is this because each ASP page is called in its own process?
> Does that mean that when the process is completed (at the end of the
> page), the handle and the memory resident document are removed anyway?
> If it does, it probably means that sp_xml_removedocument is not
> needed. If it doesn't, does anyone know what to do to get this to
> work?
>
> -- Jack Zinn
- Next message: Michael Rys [MSFT]: "Re: xml storage model in yukon"
- Previous message: Michael Rys [MSFT]: "Re: OPENXML Stored Procedure"
- In reply to: Jack Zinn: "sp_xml_removedocument can't find handle"
- Next in thread: Jack Zinn: "Re: sp_xml_removedocument can't find handle"
- Reply: Jack Zinn: "Re: sp_xml_removedocument can't find handle"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|