次の方法で共有


AttachSubscriptionDatabase Method

この機能は、将来のバージョンの Microsoft SQL Server では削除される予定です。新規の開発作業ではこの機能を使用しないようにし、現在この機能を使用しているアプリケーションは修正することを検討してください。

The AttachSubscriptionDatabase method attaches a copied subscription database to a Subscriber.

構文

object
.AttachSubscriptionDatabase(
szDatabaseName 
,
szFilename 
,
SubscriberSecurityType 
,
szSubscriberLogin 
,
szSubscriberPassword 
)

Parts

  • object
    Expression that evaluates to an object in the Applies To list.
  • szDatabaseName
    String that specifies the database to attach.
  • szFilename
    String that specifies the complete path and file name from which to attach the database.
  • SubscriberSecurityType
    Long integer that specifies the type of security used at the Subscriber.
  • szSubscriberLogin
    String that specifies the Subscriber login.
  • szSubscriberPassword
    String that specifies the Subscriber password.

Prototype (C/C++)

HRESULT AttachSubscriptionDatabase(
SQLDMO_LPCSTR pszDatabaseName,
SQLDMO_LPCSTR pszFileName, 
SQLDMO_SECURITY_TYPE SubscriberSecurityType, 
SQLDMO_LPCSTR pszSubscriberLogin, 
SQLDMO_LPCSTR pszSubscriberPassword);

Settings

Set SubscriberSecurityType by using these SQLDMO_SECURITY_TYPE values.

Constant Value Description

SQLDMOSecurity_Integrated

1

Allow Windows Authentication only.

SQLDMOSecurity_Mixed

2

Allow Windows Authentication or SQL Server Authentication.

SQLDMOSecurity_Normal

0

Allow SQL Server Authentication only.

SQLDMOSecurity_Unknown

9

Security type unknown.

解説

After using the CopySubscriptionDatabase method to copy a subscription database to a Subscriber, you must use AttachSubscriptionDatabase to attach the database at the Subscriber.

ms133947.note(ja-jp,SQL.90).gifメモ :
If an application calls AttachSubscriptionDatabase on an instance of SQL Server version 7.0, the constant, SQLDMO_E_SQL80ONLY, and the message "This property or method requires Microsoft SQL Server 2000" are returned.

Applies to:

Replication2 Object

参照

関連項目

AttachSubscriptionDatabase Method

ヘルプおよび情報

SQL Server 2005 の参考資料の入手