w3pop.com :: 网络学院 :: ADO :: ADO Save 方法
The Save method saves a Recordset object to a file or a Stream object. When the save method is finished, the record pointer will point at the first record of the Recordset.
Save的作用是:将一个Recordset[记录集]对象保存到一个文件中或保存到一个Stream对象中。当完成了save方法,那么记录指针将指向记录集中的第一条记录。
Note: If there is a filter applied to the Recordset, only the "filtered" records will be saved.
注意:如果未在记录集中设置了filter[过滤器],那么仅“被过滤”的记录。
Note: This method can only be called on an open Recordset.
注意:只有打开了记录集对象才能请求该方法。
objRecordset.Save destination,persistformat |
| Parameter参数 | Description描述 |
|---|---|
| destination | Optional. Specifies where to save the Recordset object; the path name of a file or a reference to a Stream object 可选参数。指定记录集存储的位置,该位置指向一个文件路径名或一个Stream对象参数路径名 |
| persistformat | Optional. A PersistFormatEnum value that specifies the format of the Recordset (XML or ADTG). Default is adPersistADTG 可选参数。指定一个PersistFormatEnum值,该值是用来指明记录集(XML或ADTG)的格式的。默认值为:adPersistADTG |
|
You can save a Recordset in XML format: <%
set xmlDoc=CreateObject("Microsoft.XMLDOM")
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "c:/webdata/northwind.mdb"
set rs = Server.CreateObject("ADODB.recordset")
rs.Open "Customers", conn
'Save the Recordset into a DOM tree
rs.Save xmldoc, 1
%>
|
| Constant 常量 |
Value 值 |
Description 描述 |
|---|---|---|
| adPersistADTG | 0 | Saves in a Microsoft Advanced Data TableGram (ADTG) format. 默认值。使用专用的“Advanced Data Tablegram”格式保存 |
| adPersistXML | 1 | Saves in Extensible Markup Language (XML) format 使用“扩展标记语言[XML]”格式保存 |
| adPersistADO | 1 | Saves in ADO's own Extensible Markup Language (XML) format. This value is the same as adPersistXML and is included for backwards compatibility 使用ADO本身的“扩展标记语言[XML]”格式保存。这个值与adPersistXML相同,并且它包含“指针后置(即指针向后移动)”功能 |
| adPersistProviderSpecific | 2 | The provider will persist the Recordset using its own format 技术提供对象[provider]将使用自身附带的格式保留记录集[Recordset]对象 |
评论 (0)
All