數據連接庫,更簡單、更易管理、更安全的數據連
數據連接庫,更簡單、更易管理、更安全的數據連

譯者:ikolo? 來源:http://blogs.msdn.com/excel 發表于:2006年7月7日
Excel Services part 10: Data Connection Libraries, or connecting to databases made easy, manageable, and secure Excel 服務第十部分:數據連接庫,更簡單,更易管理,更安全的數據連接
In the past few posts I have talked about all the work we have done to make managing, sharing, and securing your Excel workbooks better using SharePoint and Excel Services. Today, I am going to cover a new feature that provides management, sharing, and security of data connections – the Data Connection Library (DCL). 過去幾篇文章里我們已經討論過所有使用SharePoint和Excel服務以實現對Excel工作簿更好的管理、共享以及安全的方法。今天,我將要介紹一個可以對數據連接實現管理、共享和安全性的新功能--數據連接庫DCL(Data Connection Library)。
What is a Data Connection Library? A Data Connection Library (or DCL) is a new type of SharePoint library (much like a document library) that provides a place to store, share, and manage connection files. By connection files, I mean Office Data Connection (ODC) files which contain all the information and parameters needed to form a data connection, such as server name, OLAP cube or table name, and query (note – ODC files are not a new feature – they were introduced in Excel 2002). Since the DCL is a library in SharePoint, it comes with all the great SharePoint features you would expect – such as workflow support, file approval, library level/item level security, and sorting filtering based on metadata. You can create a DCL the same way you create any library, and DCLs can be created almost anywhere in SharePoint e.g. on a portal, team site, etc. Here is what a DCL looks like in SharePoint 12. 什么是數據連接庫? 數據連接庫(DCL)是一種新的SharePoint庫,很像一個文檔庫,它提供了一個存儲、共享以及管理連接文件的空間。連接文件,這里是指一個包含了用于構建一個完整數據連接的信息和字段(例如:服務器名,OLAP CUBE,表和查詢等)的ODC(Office Data Connection)連接文件(注:ODC文件是在Excel 2002中被引入的)。鑒于DCL是一個SharePoint的庫,正如你所期望的一樣,它也帶來了SharePoint的所有強大功能,像工作流的支持,文檔的簽入簽出,庫或項目級的安全性,基于元數據的歸類和過濾。你可以像創建任何庫一樣的創建一個DCL文件,此外,DCL可以創建在SharePoint中幾乎任何地方,例如:一個門戶,工作組站點等等。下面是一幅SharePoint 12中DCL的樣子:
Even though the DCL reuses the library concept in SharePoint, it is much more valuable than just a document library full of connection files – this is because of how Excel interacts with the DCL. Let’s take a look at that and see how the DCL and Excel 12 solve a few problems. 雖然,DCL再次使用了SharePoint庫的概念,但它比一個單純的連接文件的文件庫有價值的多,這是Excel和DCL的互動機制決定的。讓我們看看DCL和Excel 12如何解決一系列的問題。
Connecting to databases made easy … Setting up a connection to a database in Excel is a task that many users struggle with – for example, if you want to connect to an ODBC datasource or SQL Server Analysis Services cube, users must know server names, cube names, table names, what type of connection to create, user credentials, etc. Lots of clicks and knowledge are required. 更簡單的數據庫連接… 在Excel中建立數據庫連接,是很多用戶的努力要完成的任務--例如:如果你想連接一個ODBC數據源或者一個SQL Server Analysis Services cube,用戶必須知道服務器名稱,cube名稱,表名稱,想要創建的連接類型,用戶憑證等等。這需要太多的步驟和相關的知識。
Excel 12 and DCLs make connecting to databases a much simpler, faster activity. Users will simply need to know what data they want to work with, and that’s pretty much it. Let’s take a look at an example of getting started with a PivotTable connected to a database in Excel 12. Excel 12和DCL讓數據庫連接變得更加簡單和快速。用戶需要知道的全部內容就僅僅是他要處理什么樣的數據。讓我們來看一個在Excel 12中以數據透視表連接到數據庫的例子。
To connect to a database (or other external data source like a web query) in Excel 12, users will use the Data tab. Here is a shot of the Data tab in the beta build (note, this is not the final UI we will ship). 要在Excel 12中連接到一個數據庫(或者其它像web查詢一樣的外部數據源),用戶要使用Data標簽。下面是一個beta版中數據(Data)標簽的截圖(注:這并不是最終的界面)。
One point to note is that these connections all have friendly names and non-technical descriptions, so it is easy for users to choose the connection they want. Those names and descriptions are provided by the person(s) who set up the DCL and populate it with ODC files – more on this below. 有一點需要要說明的是,所有的這些連接都有一個友好的名字和一些非技術性的描述,所以你可以很容易的選擇你想要的連接。那些名稱和描述都是由設置DCL和存儲ODC文件的人提供的,關于這一點,下面將有詳細的闡述。
Next, the user simply needs to highlight the connection they want to use and press open. At this point, they see another dialog which allows the user to tell Excel 12 what to do with the data. 接著,用戶只要簡單的選中要使用的連接,然后單擊打開。這時,就可以看見另一個對話框詢問將要如何使用該數據。
Some of you are probably asking how the connections ended up in the DCL in the first place. In general, we anticipate that either departmental “connection-savvy” power users or IT will author data connection files and put them in DCLs where the connections will be reused by many people in the organization. 也許有些人會問,在第一個地方的DCL中的連接是如何結束的。通常來說,我們預計的是,部門的高級用戶或者IT人員將會驗證數據連接文件,并將組織中用戶需要重復使用的連接存放在DCL中。
You may also be asking how Excel knows about the existence of DCLs. SharePoint has a new feature that allows the administrator to “advertise” the location of the DCL to Office 12 clients, allowing connections from a DCL to show up in Excel 12. Of course, the DCL only shows up if the user has permissions to access those connection files. 也許你依然會問,Excel是怎么知道那些已有的DCL的。在SharePoint中有一個允許administrator將DCL位置”廣告”(advertise)給所有Office 12客戶端的新功能,它可以讓Excel 12顯示DCL中的連接。當然,DCL只會顯示用戶擁有訪問權限的連接文件。
Solving connection management problems … In addition to improving discoverability of connections, DCLs will help customers manage connections. Information about data sources can change, such as server name, OLAP cube name, table name, etc. – a typical example is a database moving from a test server to a production server. For organizations that have many authors, it may be difficult to communicate these changes to all the right people. Worse yet, there may be hundreds of existing workbooks that need to have their data connections updated. The DCL helps solve these problems because customers will only need to update a single connection file in the DCL with new information. After they have done so, workbook authors will get the right connection information the next time they use that connection file, and any existing workbooks that were created using the connection file will now have their connections updated automatically the next time that workbook’s data is refreshed. 解決連接管理的問題… 除了提高查找連接的能力,DCL還會幫助客戶管理連接。數據源的信息是可以修改的,例如服務器名稱,OLAP CUBE名稱,表名稱等等,一個典型的例子就是當數據庫從一個測試服務器轉移到發布服務器上的時候。一個組織中當然會有很多個作者,要把這樣的改變告訴所有的用戶太困難了。更糟的可能是,數以百計的已有工作簿需要更新它們的數據連接。DCL解決了這個問題,現在用戶僅需要更新DCL中的一個連接文件就可以了。之后,工作簿的作者們在下一次使用連接文件的時候就可以得到正確的連接信息了,所有使用這些連接文件創建的已有工作簿都會更新它們的連接和工作簿中的數據。
How exactly does this work? By default, workbooks will refresh their connection information from a DCL only when they fail to connect to the data source (you might think of this as a “failover” mechanism). But we have also added the ability to force workbooks to always get the latest connection information before attempting to connect. An example of when this might be useful is when you want workbook authors to start using a new database for business reports, but you still want to keep the old database around and functioning for auditing or test reasons. Connections to the old database still work, but you want current and future workbooks to start using the new database. The “always use this file to refresh data” setting is designed for exactly that kind of scenario. The setting is a property in the ODC file itself – it can be set when the ODC file is created (pictured below). 這究竟是如何工作的呢?默認情況下,工作簿僅會當它們連接數據源失敗的時候才會從DCL中刷新它們的連接信息(你也許認為這是一種失效轉移“failover”機制)。但是我們也增加了強制工作簿永遠在嘗試連接前更新連接信息的功能。一個可以體現這種機制好處的例子是:當你希望那些工作簿的作者將新的數據庫用于工作報告的時候,可是你仍然想保持原本的數據庫用于審計或者測試的環境和功能。舊的數據連接依然可以使用,但是你希望當前以后的工作簿都使用新的數據庫。始終使用此文件更新數據(always use this file to refresh data)的設定就是為這種情況設計的。這個設定是ODC文件本身的一項屬性,它可以在創建ODC文件的時候設定(如下圖)。
Making data connectivity more secure … Now that we have talked about discoverability and manageability, let’s conclude by looking at how the DCL can be used to make connecting to data more secure. 更安全的數據連接… 到此,我們已經討論了DCL連接和管理的方便性,最后讓我們看看DCL是如何實現更安全的數據連接的。
One common security concern is knowing which data connections are safe to run – for example, data connections can contain malicious queries, or they could contain connection parameters that can slow an app down or compromise the integrity of the data. By creating a DCL, and by only allowing most knowledgeable and trusted “connection authors” to save connections to the DCL, you add an extra layer of security that helps ensure that connections coming from a DCL safe to run. 一個通常會遇到的安全問題是,如何判斷數據連接是安全的。舉例來說,一個數據連接可能包含惡意查詢,或者它們的連接字段會拖慢程序的運行速度,也有可能會損害數據完整性。通過使用DCL,再加上僅允許最值得信任的權威連接作者(connection authors)在DCL中保存連接,就相當于又增加了額外的安全層以確保DCL中的連接是可以安全運行的。
In a previous entry, I talked about Trusted Locations on Excel Services as a means to ensure that malicious workbooks were prevented from running on the server. Much like Trusted Locations, Excel Services has “Trusted Connection Libraries” for data connections. Excel Services has a mode where it will only process data connections from DCLs that the administrator has explicitly marked as “trusted” by the server. As mentioned above, data connections have many security threats associated with them – in many ways processing a data connection can be like running code. By providing Trusted Connection Libraries, Excel Services gives the administrator the ability to allow only specific data connections to be run on the server. 上面的內容闡述了Excel服務中的信任位置(Trusted Locations),它確保了惡意工作簿不能在服務器上運行。和信任位置非常相似,Excel服務對與數據連接還有一個信任連接庫(Trusted Connection Libraries)的概念。Excel服務有一個僅處理被administrator明確標記為信任(Trusted)的DCL中數據連接的運行模式。通過信任連接庫機制,Excel服務讓administrator可以僅允許特定的數據連接在服務器上運行。
That’s it for DCLs. Next time we will take a look at how Excel Services integrates with SharePoint dashboards. 這就是DCL了。下次我們會討論Excel服務是如何與SharePoint儀表盤整合的。
Published Tuesday, November 29, 2005 9:57 AM by David Gainer
版權聲明:本文內容由網絡用戶投稿,版權歸原作者所有,本站不擁有其著作權,亦不承擔相應法律責任。如果您發現本站中有涉嫌抄襲或描述失實的內容,請聯系我們jiasou666@gmail.com 處理,核實后本網站將在24小時內刪除侵權內容。
版權聲明:本文內容由網絡用戶投稿,版權歸原作者所有,本站不擁有其著作權,亦不承擔相應法律責任。如果您發現本站中有涉嫌抄襲或描述失實的內容,請聯系我們jiasou666@gmail.com 處理,核實后本網站將在24小時內刪除侵權內容。