ADO Save to XML HELP!

This is a discussion on "ADO Save to XML HELP!" within the Classic ASP section. This forum, and the thread "ADO Save to XML HELP! are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > Classic ASP

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Nov 25th, 2005, 12:36
New Member
Join Date: Nov 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
ADO Save to XML HELP!

Hello.

I have a sample ASP script that will open an Access db, run a SQL query, and use the save feature of the ADODB recordset to the response buffer (to display it on screen):

oRS.Save Response, adPersistXML

This is the standard way I have seen on most ADO Save examples.

I made this script at work, and it functions as expected. An example of the results from the script:
<xml>
-
<s:Schema id="RowsetSchema">
-
<s:ElementType name="row" content="eltOnly">
-
<s:AttributeType name="ID" rs:number="1" rs:maydefer="true" rs:writeunknown="true">
<s:datatype dt:type="int" dt:maxLength="4" rsrecision="10" rs:fixedlength="true"/>
</s:AttributeType>
-
<s:AttributeType name="price_group_ID" rs:number="2" rs:nullable="true" rs:maydefer="true" rs:writeunknown="true">
<s:datatype dt:type="int" dt:maxLength="4" rsrecision="10" rs:fixedlength="true"/>
</s:AttributeType>
-

Great stuff. However, I took the script home, and tried to run it on my XP PRO, and got an error. I loaded the script onto a hosting companies webserver, and got the same error. I loaded the script onto a 2nd and 3rd webserver, and got the same error.

The error is :

XML Parsing Error: not well-formed
TG! (with some squares before the TG)

When I view the source (Only works in Firefox, IE says no source) I get:
TG!???????#?_Xtc??????????@??????\?????Dw=?I?<???? _?X!?ID
etc etc etc.

Now this is the same script, using the same database. It works on
1) my work server. Windows 2000 server.

It doesnt work on

1) XP PRO SP2, IIS 5.1

2) Windows 2000 server (hosting company 1)

3) Windows 2000 server (hosting company 2)

4) Windows 2003 server (Hosting compoany 3)

Can anyone help shed some light on this? I am running lates version of MDAC at home, and all service patches. I ran MS Component checker, and it says all is installed ok. Below is the code.

Why does it work at work but on no other server? All the examples on the web show the Save method working fine, and am stumped. I have googled but cant find anything.

Please can anyone help?



<%
dim objConn
dim oRS
dim connStr, sSQL
sSQL = "select * from _storePriceGroupsMatrix"
connStr = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & Server.MapPath("webData.mdb")

Response.ContentType="text/xml"

Set objConn = Server.CreateObject("ADODB.Connection")
Set oRS = Server.CreateObject("ADODB.Recordset")
objConn.open connStr

Set oRS.ActiveConnection = objConn
oRS.Open sSQL
oRS.Save Response, adPersistXML

If oRS.STATE = adStateOpen Then oRS.Close
If objConn.STATE = adStateOpen Then objConn.Close
Set oRS = Nothing
Set objConn = Nothing %>
Reply With Quote

  #2 (permalink)  
Old Nov 28th, 2005, 09:53
Rob's Avatar
Rob Rob is offline
Head Admin & CEO

SuperMember
Join Date: Jul 2003
Location: at my desk
Age: 34
Posts: 2,952
Blog Entries: 7
Thanks: 7
Thanked 4 Times in 4 Posts
Send a message via MSN to Rob Send a message via Skype™ to Rob
Re: ADO Save to XML HELP!

Not having dealt with what you are attempting before, I can only say that I think this may be character encoding that's responsible for this.

Your home server may have a default set that is different from the hosts.... I would definitly continue investigations along these lines.

Post back here if you find the cause.
__________________
Rob - SEO Specialist
Owner & Founder of Webforumz.com

I am currently unavailable for private work
Reply With Quote
Reply

Tags
ado, save, xml, help

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
save order in the Mysql mcnika Databases 0 Mar 30th, 2008 08:54
Save Mr T. Accurax Webforumz Cafe 59 Dec 13th, 2006 13:44
Save Target As VanderBOOM JavaScript Forum 4 Dec 15th, 2005 10:25
save accessman Databases 0 Sep 21st, 2005 03:56


All times are GMT. The time now is 20:58.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43