微软使得将ActiveX数据对象(ADO)的Recordset作为XML在ADO 2.1里保存成为可能。这对于将Recordset保存在客户计算机上用于脱机使用很有用处。如果你希望通过可扩展样式表语言转换(XSLT)来操控Recordset的数据,那么这一能力也是很有用的。 Dim rst As Recordset Set rst = New Recordset 如果所指定的文件命已经存在,那么对Save方法的调用就会导致一个运行错误。 要打开已经保存的Recordset,就要将文件名传递给Recordset的Open方法。设置ActiveConnection属性能够让你将Recordset保存会数据库里: Dim rst As Recordset Set rst = New Recordset MsgBoxrst.RecordCount
要将Recordset作为XML来保存,就要调用Save方法,并将目标文件及adPersistXML标志进行传递:
rst.ActiveConnection = “PROVIDER=SQLOLEDB;DATA SOURCE=SQLServer;” & _
“Initial Catalog=pubs;Integrated Security=SSPI”
rst.CursorLocation = adUseClient
rst.Open “Select * from authors where au_lname = Smith”
rst.SaveApp.Path & “\recordset.xml”, adPersistXML
rst.Close
rst.CursorLocation = adUseClient
rst.OpenApp.Path & “\recordset.xml”
rst.ActiveConnection = “PROVIDER=SQLOLEDB;DATA SOURCE=SQLServer;” & _
“Initial Catalog=pubs;Integrated Security=SSPI”
将recordset作为xml保存_asp技巧
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 将recordset作为xml保存_asp技巧
相关推荐
- 暂无文章
