|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
asp,你就只能等着微软给你解决,它不乐意你就只好悲催。而且asp跑在windows服务器上,windows服务器跟linux比起来简直弱爆了!ado|xml <!-- METADATA TYPE="TypeLib" UUID="00000200-0000-0010-8000-00AA006D2EA4" -->
<%
Class DataSet
Private Recordset
Public TableName, FieldCount
Public XmlString
Private TableMap
Private Sub Class_Initialize ' 设置 Initialize 事务。
Set Recordset = Server.CreateObject("ADODB.RecordSet")
Recordset.ActiveConnection = "Provider=MSDAOSP; Data Source=Msxml2.DSOControl;"
End Sub
Private Sub Class_Terminate ' 设置 Terminate 事务。
Set Recordset = Nothing
End Sub
Function ReadXml(Name, filespec)
TableName = Name
Recordset.Open(filespec)
End Function
Function GetXml()
Call GetTableMap()
Do While not Recordset.Eof
XmlString = XmlString + GetXmlRow(Recordset.Fields)
Recordset.MoveNext()
Loop
Recordset.Close
XmlString = XmlRow(TableName, XmlString)
GetXml = XmlString
End Function
Sub GetTableMap()
IF (not Recordset.Eof) Then
FieldCount = Recordset.Fields.Count - 2
Execute("ReDim TableMap("& FieldCount &")")
For i = 0 To FieldCount
TableMap(i) = Recordset.Fields.Item(i).Name
Next
End IF
End Sub
Function GetXmlRow(Item)
Dim XmlRowString
For i = 0 To FieldCount
XmlRowString = XmlRowString + XmlField(TableMap(i), Item(i).Value)
Next
GetXmlRow = XmlRow("Row", XmlRowString)
End Function
Function XMlEncode(XmlString)
XmlString = WordStr(XmlString, "<", "<")
XmlString = WordStr(XmlString, ">", ">")
XMlEnCode = XmlString
End Function
Function XmlField(NodeName, NodeValue)
XmlField = "<"+ NodeName +">"+ XMlEncode(NodeValue) +"</"+ NodeName +">"
End Function
Function XmlRow(NodeName, NodeValue)
XmlRow = "<"+ NodeName +">"+ NodeValue +"</"+ NodeName +">"
End Function
End Class
Dim ds : Set ds = new DataSet
Call ds.ReadXml( "News", Server.MapPath("news.xml") )
Response.ContentType = "text/xml"
Response.Write(ds.GetXml())
Set ds = Nothing
%>
</p> 强大的可扩展性。ASP具有强大的扩展性,可以实现与多种网络、硬件设备的连接:通过专用的通讯线路远程接入企业; 通过远程拨号服务器为远程拨号客户提供服务;通过WAP为移动电话互联网客户服务。 |
|