中文字幕天天躁日日躁狠狠躁,最近中文字幕大全免费版在线,最近2019免费中文字幕视频三,亚洲精品无码你懂的,亚洲国产精品成人精品小说

  • 相關(guān)軟件
    >將Recordset作為XML保存 創(chuàng)建者:webmaster 更新時間:2005-07-02 00:37

    微軟使得將ActiveX數(shù)據(jù)對象(ADO)的Recordset作為XML在ADO 2.1里保存成為可能。這對于將Recordset保存在客戶計算機上用于脫機使用很有用處。如果你希望通過可擴展樣式表語言轉(zhuǎn)換(XSLT)來操控Recordset的數(shù)據(jù),那么這一能力也是很有用的。


    要將Recordset作為XML來保存,就要調(diào)用Save方法,并將目標(biāo)文件及adPersistXML標(biāo)志進(jìn)行傳遞:


    Dim rst As Recordset

    Set rst = New Recordset
    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


    如果所指定的文件命已經(jīng)存在,那么對Save方法的調(diào)用就會導(dǎo)致一個運行錯誤。


    要打開已經(jīng)保存的Recordset,就要將文件名傳遞給Recordset的Open方法。設(shè)置ActiveConnection屬性能夠讓你將Recordset保存會數(shù)據(jù)庫里:


    Dim rst As Recordset

    Set rst = New Recordset
    rst.CursorLocation = adUseClient
    rst.OpenApp.Path & "\recordset.xml"
    rst.ActiveConnection = "PROVIDER=SQLOLEDB;DATA SOURCE=SQLServer;" & _
                           "Initial Catalog=pubs;Integrated Security=SSPI"

    MsgBoxrst.RecordCount


    相關(guān)文章
    本頁查看次數(shù):