Skip to content

Latest commit

 

History

History
77 lines (57 loc) · 2.97 KB

localdbshareinstance-function.md

File metadata and controls

77 lines (57 loc) · 2.97 KB
title description author ms.author ms.date ms.service ms.topic apilocation apiname apitype
LocalDBShareInstance Function
LocalDBShareInstance Function
markingmyname
maghan
03/06/2017
sql
reference
sqluserinstance.dll
LocalDBShareInstance
DLLExport

LocalDBShareInstance Function

[!INCLUDE SQL Server] Shares the specified SQL Server Express LocalDB instance with other users of the computer, using the specified shared name.

Header file: msoledbsql.h

Syntax

HRESULT LocalDBShareInstance(  
           PSID pOwnerSID,  
           PCWSTR pInstancePrivateName,  
           PCWSTR pInstanceSharedName,   
           DWORD dwFlags   
);  

Parameters

pOwnerSID
[Input] The SID of the instance owner.

pInstancePrivateName
[Input] The private name for the LocalDB instance to share.

pInstanceSharedName
[Input] The shared name for the LocalDB instance to share.

dwFlags
[Input] Reserved for future use. Currently should be set to 0.

Returns

S_OK
The function succeeded.

LOCALDB_ERROR_NOT_INSTALLED
SQL Server Express LocalDB is not installed on the computer.

LOCALDB_ERROR_INVALID_PARAMETER
One or more specified input parameters are invalid.

LOCALDB_ERROR_INVALID_INSTANCE_NAME
The specified instance name is invalid.

LOCALDB_ERROR_UNKNOWN_INSTANCE
The specified instance does not exist.

LOCALDB_ERROR_ADMIN_RIGHTS_REQUIRED
Administrator privileges are required in order to execute this operation.

LOCALDB_ERROR_SHARED_NAME_TAKEN
The specified shared name is already taken.

LOCALDB_ERROR_INSTANCE_ALREADY_SHARED
The specified instance is already shared.

LOCALDB_ERROR_INTERNAL_ERROR
An unexpected error occurred. See the event log for details.

Remarks

For a code sample that uses LocalDB API, see SQL Server Express LocalDB Reference.

See Also

SQL Server Express LocalDB Header and Version Information