?? readme.txt
字號:
========================================================================
MICROSOFT FOUNDATION CLASS LIBRARY : RcMSSQL
========================================================================
This source code drills down on administering SQL Server databases
with the SQL Distributed Management Objects (SQL-DMO) object model.
This model is interesting to Office developers for three reasons:
1. It allows you to programmatically manipulate SQL Server with a hierarchical object model.
Most intermediate and advanced Access developers have substantial experience programming
hierarchical object models working with the Office models.
This means they can easily come up to speed on SQL-DMO.
2.Microsoft used SQL-DMO to program SQL Server's Enterprise Manager.
This graphical tool offers capabilities for SQL Server databases
similar to those Database window offers for Jet databases.
However, Enterprise Manager is not shipped with MSDE.
Therefore, developers working with MSDE can build subsets of Enterprise Manager capabilities
into their solutions by developing programs with SQL-DMO.
3.SQL-DMO exposes COM interfaces. This enables Access developers to program SQL-DMO
as easily as creating a reference to its library and manipulating its objects - just as you
do the object models of other Office components, such as Excel or Word.
The SQL-DMO Object Model:
It displays selected objects referenced throughout this article while it
presents an overview of the model's structure. At the top of the SQL-DMO model
is the Application object. This is the source for all other SQL-DMO objects and collections.
SQLObjectList
|_______Application The word no postfix 's' is Object
|_______SQL Servers The word add postfix 's' is Collenction
|_______SQL Server
|_______Databases
|_______Database
|_______Tables
|_______Table
|_______Indexes
|_______Keys_______Key
|_______Columns_______Column
FIGURE 1: Abridged SQL-DMO object model.
Right below the Application object is the SQLServers collection. The members of
this collection point at any SQL Server to which your workstation connects.
Use a SQLServer object's Connect method to have the object reference a specific SQL Server,
such as the one for the local workstation, which can be an MSDE server.
In any computing environment, you can have multiple SQL Servers.
My office has MSDE on one workstation, SQL Server 7 on a couple of other workstations,
and SQL Server 2000 on two more workstations. Mid-sized and large organizations
will often have one or more SQL Servers as development servers, and other SQL Servers
that service a community of users for normal operating requirements. In these environments,
developers sometimes need to copy databases for use on the road.
These on-the-road applications often work best with disconnected computers.
MSDE can be cost effective for these applications with disconnected computers,
and SQL-DMO can help to efficiently administer those database applications.
On any given server, you can have one or more databases. Each SQLServer object
has its own Database collection. Within each database are database objects,
such as tables, views, and stored procedures.
Views and stored procedures roughly correspond to stored queries for Jet databases.
The Tables collection in a SQL Server database behaves similarly, but not identically,
to the Tables collection in a Jet database. For example, any given table can have columns,
keys, and indexes. A Column object enables you to manipulate the properties of a single column
in a SQL Server table. You can also add and remove individual columns in a table
with the Column object.
SQL Server also supports Key objects that can serve as the primary key and a foreign key
for a table. Unlike Jet, SQL Server primary keys can be clustered, so records are physically
stored in primary-key order. This greatly expedites retrieval. You have the choice of
enabling the Clustered property of any other index for a table. Of course,
because records can be physically ordered just one way on a storage device,
you can enable the Clustered property of just one index per table.
Getting Started with SQL-DMO
The Help file for SQL-DMO is named sqldmo.hlp for SQL Server 7,
and sqldmo80.hlp for SQL Server 2000.
HOWTO: Deploy SQL Distributed Management Objects
with the Visual Basic Package and Deployment Wizard
File Name Path
Sqldmo.dll \Mssql7\Binn\
Sqldmo.rll \Mssql7\Binn\Resources\1033\
Sqlresld.dll \Mssql7\Binn\
Sqlsvc.dll \Mssql7\Binn\
Sqlsvc.rll \Mssql7\Binn\Resources\1033\
Sqlwoa.dll \Windows\System32\
Sqlwid.dll \Windows\System32\
W95scm.dll \Mssql7\Binn\
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -