Submit Your Article Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > The Code > Classic ASP

Reply
 
LinkBack Thread Tools
Old November 25th, 2005, 08:36 AM   #1
New Member
 

Join Date: Nov 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 bilfwebb is on a distinguished road
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 %>
bilfwebb is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old November 28th, 2005, 05:53 AM   #2
Rob
Elite Veteran
SuperMember
 
Rob's Avatar
 

Join Date: Jul 2003
Location: Southern UK
Age: 35
Posts: 3,126
Blog Entries: 7
Thanks: 28
Thanked 22 Times in 19 Posts
Rep Altering Power: 0 Rob is a jewel in the rough Rob is a jewel in the rough Rob is a jewel in the rough
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 - Webforumz Founder
Web Designer Support Network || Personal Project: Sanctuary for Student Midwives
Rob is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks

Tags
ado , save , xml , help


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 March 30th, 2008 04:54 AM
Save Mr T. Accurax The Café 59 December 13th, 2006 09:44 AM
Save Target As VanderBOOM JavaScript 4 December 15th, 2005 06:25 AM
save accessman Databases 0 September 20th, 2005 11:56 PM


Search Engine Optimization by vBSEO 3.2.0 RC8