My Web Site

[Previous] [Next]

The My Web Site sample shows how you can use the ADO object model—especially its two new objects, Record and Stream—in conjunction with the OLE DB Provider For Internet Publishing to build a simple tool to access files residing on a web server. This OLE DB provider is not actually distributed with Microsoft Data Access Components (MDAC). However, it's included in the full install of Microsoft Internet Explorer 5.

I built this sample to communicate with Internet Information Services (IIS) 5 running on Windows 2000 Server, but I was able to use the sample with Internet Information Server 4 running on Microsoft Windows NT 4.0 Server as well, and with Personal Web Server running on Windows NT 4.0 Workstation. The OLE DB provider uses WebDAV—a standard that most web servers support—to communicate with the web server.

For security reasons, web servers generally require that you have administrator rights to the areas of the web site that you want to access. Unfortunately, I am not an IIS security guru, so I'm not sure exactly which settings you might need to use. I didn't change any security settings on my computer running Windows 2000 Server and was able to run the code successfully from it as well as from other computers on the internal network at my office. Once you can connect successfully, you should be able to run the sample without any problems.

When you run the sample, it immediately displays a simple dialog box prompting you for the location of the web site you want to manage. The sample then connects to that web server using the OLE DB Provider For Internet Publishing and displays the contents of the web site in tree view.

From there you can copy, delete, move, and download files by right-clicking them and selecting the appropriate action from the context menu. You can also upload new files by right-clicking a folder and selecting Upload File. Right-clicking a folder also lets you copy, delete, or move that folder and all its contents.

The code in this sample is simple and straightforward—which is why I created it. Using ADO and the OLE DB Provider For Internet Publishing, you can manage the contents of your web servers with some very simple code.



Programming ADO
Programming MicrosoftВ® ADO.NET 2.0 Core Reference
ISBN: B002ECEFQM
EAN: N/A
Year: 2000
Pages: 131
Authors: David Sceppa

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net