I saw a lot of netizens asked, I have two servers, how to intermitte to the MDB database data on both servers. Today, a remote interface is made, and the data in the MDB is returned in XML. The main idea is to fill the data into an XML DOM through the SAVE method of the Recordset object, but the XML generated by this method is not simple enough. The automatically generated XML contains SCHEMA information, which describes what nodes allowed in this XML and Attributes and what data types are used, and the data nodes also add namespaces. SCHEMA information is very useful in places requiring data verification or more complex processing, but in most cases, we use thin clients, we don't need SCHEMA information. We can use XSLT to separate the information we want and remove excess information.
The code is as follows: <% 'Generate XSL Style Str = CHR (13) & chr (10) & chr (9) xslt = "
CHR (9) _ & " xsl: Element> & Str & Chr (9) & chr (9) & chr (9) & chr (9) _ &" xsl: for-each> "& str & chr (9) & chr ( 9) & chr (9) _ & " xsl: Element> & str & chr (9) & chr (9) _ &" xsl: for-each> "& str & chr (9) _ &" xsl: Element > "& str_ &" xsl: template> "& chr (13) & chr (10) _ &" xsl: style "" read database curdir = server.mappath ("data.mdb") set conn = server.createobject ( "adodb.connection") conn.Open "Provider = Microsoft.Jet.OLEDB.4.0; Data Source =" & curDirset rs = conn.Execute ( "select * from admins") Dim objXMLDOMSet objXMLDOM = Server.CreateObject ( "MSXML2.DOMDocument.3.0") 'to save the recordset into objects in dom rs.save objXMLDOM, 1Set rs = NothingDim strCleanXML, objXMLDOM_XSLTSet objXMLDOM_XSLT = CreateObject ( "MSXML2.DOMDocument") objXMLDOM_XSLT.loadXml (xslt)' format with xsl Data strcleanXML = objxmldom.transformNode (objxmldom_xslt) set objxmldom = NothingSet Objxmldom_xslt = Nothing 'Output Data Response.write strcleanXML%>