ADO 저장 방법


❮ 완전한 레코드세트 개체 참조

Save 메서드는 Recordset 개체를 파일이나 Stream 개체에 저장합니다. 저장 방법이 완료되면 레코드 포인터가 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
persistformat Optional. A PersistFormatEnum value that specifies the format of the Recordset (XML or ADTG). Default is 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
%>

PersistFormatEnum 값

Constant Value Description
adPersistADTG 0 Saves in a Microsoft Advanced Data TableGram (ADTG) format.
adPersistXML 1 Saves in Extensible Markup Language (XML) format
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
adPersistProviderSpecific 2 The provider will persist the Recordset using its own format

❮ 완전한 레코드세트 개체 참조