태터데스크 관리자

도움말
닫기
적용하기   첫페이지 만들기

태터데스크 메시지

저장하였습니다.
페이지를 읽고 있습니다. ( 아쿠아바다's Blog )
분류 전체보기 (769)
쉐어포인트 (24)
Exchange (12)
SQL (121)
XML (36)
WEB (294)
O / S (97)
삶의향기 (162)
기획 (19)
RSS 피드(IE 7.0부터 기본 지원됩니다. 이전 버전 사용자는 접합한 툴을 사용하세요!!)

ADO 2.5 Streams and XML

XML 2007/06/07 13:58 by 아쿠아바다

Description

This sample demonstrates how to use the new Stream object in ADO 2.5 to read a recordset into XML and vice versa.

More Details

A Stream object provides the means to read, write, and manage the binary stream of bytes or text that comprise a file or message stream. In ADO 2.1 you can save a recordset to XML that is persisted to disk using the Save method and the adPersistXML option. rst.Save "pubs.xml", adPersistXML You can open a recordset based on the XML file with the Open method. rst.Open "pubs.xml" In ADO 2.5 you can use the Stream object to work with XML without having to write it to disk first. The Stream object exists in memory. In this sample the contents of a recordset are converted to XML and then written to the Stream object, which is named 'st' here. rs.Save st, adPersistXML Just as a recordset can be opened from an XML file, it can also be opened based on the XML in a Stream. rs.Open st
Setup
The sample retrieves data from the SQL Server 7.0 Northwind sample database. The connection string in the procedure btnRetrieve_Click has the following: DataSource=(local); If the SQL Server you are using is on a different machine you must use the name of that machine instead, for example if SQL Server is on a machine named Cocoa, you would use the following: DataSource=Cocoa;

Browser/Platform Compatibility and other Requirements

This sample requires Visual Basic 6.0 and Active Data Objects (ADO) 2.5. It can be run under Windows 98, Windows NT 4.0, or Windows 2000. ADO 2.5 ships with Windows 2000 and will also be downloadable from Universal Data Access Online.

Note: This content uses a beta of ADO 2.5 and is therefore for preview only and subject to change.

Usage

The sample consists of a single form. Choose Retrieve to run a query and populate a grid with a list of products. The data resides in an ADO recordset. To apply a filter to the product list enter the filter expression and choose Apply. For example you might enter the following as a filter expression: unitprice > 10Only the records that meet the filter criteria appear in the grid. To remove the filter choose Clear.

To convert the contents of the ADO recordset to XML, choose ADO -> XML. The contents of the XML appear in the bottom half of the form.

To create an ADO recordset from the XML choose XML -> ADO. The contents of the recordset are displayed in the grid.

Related Links

The following links are to related articles.



출처 : http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/samples/internet/ie55/EditRegions/default.asp

'XML' 카테고리의 다른 글

XML-RPC를 이용한 원격 메소드 호출  (0) 2007/06/07
XML Tree Viewer  (0) 2007/06/07
ADO 2.5 Streams and XML  (0) 2007/06/07
xmlrpc - javascript 연동  (0) 2007/06/07
[5분강좌] 헬로 XQuery  (0) 2007/06/07
메인 페이지 게시물 성능개선 처리 방법에  (0) 2007/06/07
좀더 흥미로운 내용이 많이 있습니다.. HOME > XML를 확인하세요
TAG ,   
0 Trackback, 0 Comment, :
1  ... 478 479 480 481 482 483 484 485 486  ... 769 
Statistics Graph
Total : 557,403 Today : 33