SAMPLE: Use the OLE DB Provider for Internet Publishing from Visual C++ (248501)



The information in this article applies to:

  • Microsoft OLE DB Provider for Internet Publishing 2.0
  • Microsoft OLE DB Provider for Internet Publishing 1.5
  • Microsoft Office XP Developer
  • Microsoft Office 2000 Developer

This article was previously published under Q248501

SUMMARY

OWebFolderSetup.exe is a sample application that is written in Microsoft Visual C++ 6.0. This sample application demonstrates how to read, write, delete, and enumerate files and folders that are on a Web server. You can do this by using Microsoft OLE DB Provider for Internet Publishing (MSDAIPP). The sample is similar to the Web Folders view in any Microsoft Office 2000 or Microsoft Office XP Open or Save dialog box. The sample is also similar to the view in My Network Places when you specify an HTTP resource as a network location.

MORE INFORMATION

The following file is available for download from the Microsoft Download Center:
Release Date: Mar-2-2003

For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:

119591 How to Obtain Microsoft Support Files from Online Services

Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on secure servers that prevent any unauthorized changes to the file.

Microsoft Data Access Internet Publishing Provider (MSDAIPP)

OLE DB Provider for Internet Publishing, also known as the Internet Publishing Provider (IPP), permits you to use OLE DB interfaces to access files and folders on Web servers that support:
  • FrontPage Server Extensions (FPSE)
  • Web Extender Client (WEC)
  • Web Distributed Authoring and Versioning (WebDAV or HTTP-DAV) protocol extension for HTTP
Currently, two versions of the provider are available for you to use:
  • By default, the 1.5 version is installed on Microsoft Windows Millennium Edition (Me), Microsoft Windows 2000, and Microsoft Windows XP computers. You can also install the 1.5 version on Microsoft Windows 98 and Microsoft Windows NT 4.0 computers. You can do this by using Microsoft Office 2000 or by using the Web Folder extension for Microsoft Internet Explorer 5. This is the standard and the most typically used version of the provider. This version provides the core functionality for Web Folder editing.
  • The 2.0 version is an extended version that is included with Microsoft Office XP and Microsoft SharePoint Portal Server 2001. This version offers better functionality and scalability. This version also includes custom functions for SharePoint interopability. The OWebFolderSetup.exe sample runs with all versions of the provider, but selectively enables some functions only when the 2.0 version is installed.
In addition to IPP, Microsoft provides a Namespace Shell Extension (NSE) for Web Folders named the Microsoft Office Web Folder NSE (MSONSEXT). MSONSEXT is typically used by My Network Places and the Open as Web Folder option of Internet Explorer. The NSE handles most user interaction to FPSE or DAV shares from the Windows shell. Internally, the NSE uses MSDAIPP to edit and to publish Web content. This sample is similar to the NSE, but it is more simplified. The sample is intended to demonstrate some of the capabilities of MSDAIPP while using a small amount of code.

Office Web Folder Setup Sample (OWebFolderSetup.exe)

The OWebFolderSetup.exe sample was written with Microsoft Visual C++ 6.0 Service Pack 5 (SP5). However, it can be compiled successfully with Microsoft Visual C++ .NET, which is included with Microsoft Visual Studio .NET. Because the MSDAIPP provider is designed to run with Microsoft Data Access Components (MDAC) 2.5 and later, you must have this version of MDAC to run the sample. Also, you must have the MDAC 2.5 headers and libraries so you can recompile the code. You can install the latest platform Software Development Kit (SDK) if you need a newer version of OLEDB.H.

The sample shows you how to use direct binding when you use the OLE DB interfaces of the provider. The core functions are encapsulated in two classes:
  • CMSDAIPPSession
  • CMSDAIPPRowset
The first class wraps functions that maintain the current HTTP session with the URL being bound to. The second class wraps the functions for a particular Web folder (rowset). Multiple CMSDAIPPRowset objects may exist for a single session. Each CMSDAIPPRowset object represents a different folder or subfolder on the Web site.

Both classes are called by the host application. The host application displays the folder contents in a list view that is similar to Explorer. The user can then upload, download, or delete items similiar to the Web Folder NSE, but with fuctionality that is more limited.

You have a royalty-free right to use, to modify, to reproduce, and to distribute this sample application, or any modified version in any way you find useful. You can do this provided that you agree that Microsoft has no warranty, obligations, or liability for the code or for the information provided herein. THE CODE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. The sample is for demonstration purposes only, and does not constitute "production-ready" code.

REFERENCES

For additional information about how to use MSDAIPP from ActiveX Data Objects (ADO) instead of OLE DB, click the following article numbers to view the articles in the Microsoft Knowledge Base:

245359 HOWTO: Open Documents Using the Internet Publishing Provider

248255 HOWTO: Use the ADO Recordset, Record and Stream Objects to Open Documents


Modification Type:MajorLast Reviewed:4/18/2003
Keywords:kbfile kbinfo kbSample KB248501 kbAudDeveloper