XML encoding with ADO recordset XML

XML encoding with ADO recordset XML

Post by Ricc » Sat, 06 Jan 2001 04:18:33



I criated a xml with the ADO rs.save method and send it through the XMLHTTP
POST .I having problems when i receive it in my ASP page, all words that
have any  foriegn caracters like , , ? , I receive with stranger
caracters in place of  this caracters.

What should i do ? change the way i sending , change the ASP page ?

I tried this but don't work
ps. oMsg: an Instance of  Microsoft.XMLHTTP

 oMsg.setRequestHeader("encoding","ISO-8859-1")

ps. oMsg an Instance of  Microsoft.XMLHTTP

tks in advance

 
 
 

XML encoding with ADO recordset XML

Post by bk.. » Sat, 06 Jan 2001 15:30:01


what's is your complete code?



Quote:> I criated a xml with the ADO rs.save method and send it through the
XMLHTTP
> POST .I having problems when i receive it in my ASP page, all words
that
> have any  foriegn caracters like , , ? , I receive with stranger
> caracters in place of  this caracters.

> What should i do ? change the way i sending , change the ASP page ?

> I tried this but don't work
> ps. oMsg: an Instance of  Microsoft.XMLHTTP

>  oMsg.setRequestHeader("encoding","ISO-8859-1")

> ps. oMsg an Instance of  Microsoft.XMLHTTP

> tks in advance

Sent via Deja.com
http://www.deja.com/

 
 
 

XML encoding with ADO recordset XML

Post by David Carne » Sun, 07 Jan 2001 01:23:32


Ricc:
I have recently wrestled with this same issue.  Here are some samples:

In my Access 97 app (reference set to Microsoft XML, version 2.0):
  Dim xmlDoc As New MSXML.DOMDocument
  Dim xmlHTTP As New MSXML.XMLHTTPRequest
  xmlDoc.async = False

I save an ADO recordset into the xmlDoc, then send it via XMLHTTPRequest.
  Set rst = New ADODB.Recordset
  With rst
    .CursorLocation = adUseClient
    .Open strSQL, conn
    .Save xmlDoc, adPersistXML  'convert the recordset into an XML document
    .Close
  End With

  'send the XML document to it's respective ASP page
  With xmlHTTP_Facility
    .Open "POST", g_strWebServer & "/b1_upload.asp", False, g_strUserName,
g_strPassword
    .setRequestHeader "Content-Type", "text/xml"
    .send xmlDoc_Facility.xml
    'get the response back and see if it was successful
    strResponseFacility = .responseText
  End With

Now to the ASP code:

set xmldoc = Server.CreateObject("Microsoft.XMLDOM")
xmldoc.async = false
xmldoc.load(Request)

At this point I put the XML into an ADO recordset an do my manipulation
there.

HTH,
Dave Carnes

 
 
 

XML encoding with ADO recordset XML

Post by Ricc » Sun, 07 Jan 2001 02:38:23


Thanks for your attention,

CLIENT SIDE:

Dim sCaminhoServer As String
Dim sXML As String
Dim sGUID As String
Dim oXMLHTTP As MSXML2.XMLHTTP

sCaminhoServer = "http://server_mts/testeXMl/ReceiveXml.asp"
'   cria a instancia para envio via http
Set oXMLHTTP = New MSXML2.XMLHTTP

oXMLHTTP.Open "POST", sServerPath, False
oXMLHTTP.setRequestHeader "encoding", "ISO-8859-1"

oXMLHTTP.send sXML
sGUID = oXMLHTTP.responseText

SERVER SIDE :

set xmldoc = server.CreateObject("Microsoft.XMLDOM")
xmldoc.async = false
xmldoc.load(Request)
set rootNode = xmlDoc.documentElement
nome = rootNode.xml
set stXML= server.createObject("ADODB.Stream")
stXML.Open
stXML.WriteText nome
stXML.Position=0
set rsXML = server.CreateObject("ADODB.Recordset")
rsXML.Open stXML


> what's is your complete code?



> > I criated a xml with the ADO rs.save method and send it through the
> XMLHTTP
> > POST .I having problems when i receive it in my ASP page, all words
> that
> > have any  foriegn caracters like , , ? , I receive with stranger
> > caracters in place of  this caracters.

> > What should i do ? change the way i sending , change the ASP page ?

> > I tried this but don't work
> > ps. oMsg: an Instance of  Microsoft.XMLHTTP

> >  oMsg.setRequestHeader("encoding","ISO-8859-1")

> > ps. oMsg an Instance of  Microsoft.XMLHTTP

> > tks in advance

> Sent via Deja.com
> http://www.deja.com/

 
 
 

XML encoding with ADO recordset XML

Post by Ricc » Sun, 07 Jan 2001 02:39:47


Tks David ,

My code its very close to yours .

Did this code worked well with this caracters or u still have this problem
??



Quote:> Ricc:
> I have recently wrestled with this same issue.  Here are some samples:

> In my Access 97 app (reference set to Microsoft XML, version 2.0):
>   Dim xmlDoc As New MSXML.DOMDocument
>   Dim xmlHTTP As New MSXML.XMLHTTPRequest
>   xmlDoc.async = False

> I save an ADO recordset into the xmlDoc, then send it via XMLHTTPRequest.
>   Set rst = New ADODB.Recordset
>   With rst
>     .CursorLocation = adUseClient
>     .Open strSQL, conn
>     .Save xmlDoc, adPersistXML  'convert the recordset into an XML
document
>     .Close
>   End With

>   'send the XML document to it's respective ASP page
>   With xmlHTTP_Facility
>     .Open "POST", g_strWebServer & "/b1_upload.asp", False, g_strUserName,
> g_strPassword
>     .setRequestHeader "Content-Type", "text/xml"
>     .send xmlDoc_Facility.xml
>     'get the response back and see if it was successful
>     strResponseFacility = .responseText
>   End With

> Now to the ASP code:

> set xmldoc = Server.CreateObject("Microsoft.XMLDOM")
> xmldoc.async = false
> xmldoc.load(Request)

> At this point I put the XML into an ADO recordset an do my manipulation
> there.

> HTH,
> Dave Carnes

 
 
 

XML encoding with ADO recordset XML

Post by David Carne » Sun, 07 Jan 2001 04:03:27


Ricc:
My code worked well; if you need more examples/explanations, feel free to
email me.  Remove 'NOSPAM' from my email address.

Ciao,
Dave

 
 
 

1. How Ado recordsets ->Multiple Xmls ->single xmlDom - > Ado recordsets?

Hi,

    I am trying to build a single xmlDom file from a set of ADO recordsets
(each recordset represent different table) and using Ado stream to get a set
of xml out.
How can I use appendChild or insertBefore method to concatenate all these
xml together? The final single xmlDom will be retrieved back to the same set
of Ado recordsets.
    Please help. Thanks,

Hualin

2. FS : A2000 w/ GVP-m 68060

3. How to return ADO-encoded XML to recordset ?

4. Info request: comp hardwa

5. Problems Opening ADO recordset with foreign characters from ASP/ADO persisted XML on a remote server.

6. Goldstar CD-ROM drivers?

7. xml from ado recordset and microsoft xml 40

8. NE2000 register programming - info needed !

9. XML Newbie - Get Recordset from XML file for ADO

10. XML 4.0 can't search ADO Recordset 2.6's XML result string properly.

11. ADO + XML: Updating recordset from xml-document

12. ado recordset --> xml

13. Creating ADO RecordSet from XML