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.
|
|
|
|
|
![]() |
||
ADO Save to XML HELP!
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
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" rs recision="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" rs recision="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 %> |
|
|
|
||||
|
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
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
![]() |
| Tags |
| ado, save, xml, help |
| Thread Tools | |
|
|
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 |