Hinweis
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, sich anzumelden oder das Verzeichnis zu wechseln.
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, das Verzeichnis zu wechseln.
Dieses Feature wird in einer zukünftigen Version von Microsoft SQL Server entfernt. Verwenden Sie dieses Feature beim Entwickeln neuer Anwendungen nicht, und planen Sie das Ändern von Anwendungen, in denen es zurzeit verwendet wird.
The ValidateDataSource method attempts a connection to the indicated data source using the login name and password specified.
Syntax
object
.ValidateDataSource(
DataSource
,
Login
,
Password
,
[ SubscriberType ] )
Parts
- object
Expression that evaluates to an object in the Applies To list.
- DataSource
Identifies an ODBC data source by name.
- Login
Specifies a Microsoft SQL Server login by name.
- Password
Password for the specified SQL Server login.
- SubscriberType
Optional. A long integer that identifies the Subscriber data source implementation as described in Settings.
Prototype (C/C++)
HRESULT ValidateODBCDataSource(
SQLDMO_LPCSTR DataSourceName,
SQLDMO_LPCSTR Login,
SQLDMO_LPCSTR Password,
SQLDMO_SUBSCRIBER_TYPE SubscriberType = SQLDMOSubInfo_ODBCDatasource);
Settings
Set SubscriberType using these SQLDMO_SUBSCRIBER_TYPE values.
| Constant | Value | Description |
|---|---|---|
SQLDMOSubInfo_/ExchangeServer |
4 |
Type property of RegisteredSubscriber object that identifies a Microsoft Exchange Server installation persisted as a SQL Server linked server. |
SQLDMOSubInfo_JetDatabase |
2 |
Name property of RegisteredSubscriber object identifies a Microsoft Jet version 3.5 database |
SQLDMOSubInfo_/ODBCDatasource |
1 |
Name property of RegisteredSubscriber object identifies an ODBC user or system DSN. |
SQLDMOSubInfo_/OLEDBDatasource |
3 |
Type property of RegisteredSubscriber object that identifies an OLE DB data source specification, or Microsoft Jet version 4.0 database persisted as a SQL Server linked server. |
SQLDMOSubInfo_SQLServer |
0 |
Name property of RegisteredSubscriber object identifies an instance of SQL Server by SQL Server name. |
Hinweise
If the ValidateDataSource method succeeds, the data source specified can be targeted in a subscription. The error SQLDMO_E_INVALIDDSN is raised when a connection is not made to the data source or the data source specified cannot otherwise receive a subscription.
Applies To:
|