Repository.ConnectToSQLRepository: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Template:APIClass|Repository Class|Repository}}
{{Template:API}}{{Template:APIBreadcrumb|.[[Repository Class|Repository]]}}
{{Template:Repository.ConnectToSQLRepository.Cmt}}
 
 
<onlyinclude>Connects to a SQL Server repository. Returns a '''Boolean''' value; when true, indicates a successful connection to the repository.</onlyinclude>


== Syntax ==
== Syntax ==
*ConnectToSQLRepository({{APIPrefix|ByVal}} ServerName {{APIPrefix|As String}}, {{APIPrefix|ByVal}} DatabaseName {{APIPrefix|As String}}, {{APIPrefix|Optional}} {{APIPrefix|ByVal}} UseImpersonation {{APIPrefix|As Boolean}} = False , {{APIPrefix|Optional}} {{APIPrefix|ByVal}} ImpersonateDomain {{APIPrefix|As String}} = "", {{APIPrefix|Optional}} {{APIPrefix|ByVal}} ImpersonateUsername {{APIPrefix|As String}} = "" , {{APIPrefix|Optional}} {{APIPrefix|ByVal}} ImpersonatePassword {{APIPrefix|As String}} = "") {{APIPrefix|As Boolean}}
'''.ConnectToSQLRepository'''(''ServerName'', ''DatabaseName'', ''UseImpersonation'', ''ImpersonateDomain'', ''ImpersonateUsername'', ''ImpersonatePassword'')
 
Parameters
:''ServerName'': The server file path for the SQL repository.


:''DatabaseName'': The database name of the repository.
===Parameters===
''ServerName''
:Required. String. The name of the SQL Server.  


:''UseImpersonation'': Whether the database requires impersonation.
''DatabaseName''  
:Required. String. The name of the database.


:''ImpersonateDomain'': The domain for the impersonation.
''UseImpersonation''
:Optional. Boolean. Indicates whether the database requires impersonation. Default value = False.


:''ImpersonateUsername'': The User Name for the impersonation.
''ImpersonateDomain''
:Optional. String. The domain for the impersonation.


:''ImpersonatePassword'': The Password for the impersonation.
''ImpersonateUsername''
:Optional. String. The account username for the impersonation.


{{Template:BooleanReturn.Cmt}}
''ImpersonatePassword''
:Optional. String. The account password for the impersonation.


== Usage Example ==


  {{APIComment|'Declare a new repository connection object.}}
==Example==
  Dim MyRepository As New Repository
'''VB|VB.NET'''
 
{{APIComment|'Connect to the Synthesis repository.}}
  {{APIPrefix|Dim}} MyRepository {{APIPrefix|As New}} Repository
  Dim Success As Boolean
MyRepository.ConnectToSQLRepository({{APIString|"MyServer"}}, {{APIString|"MyDatabase"}})
  Success = MyRepository.ConnectToSQLRepository("SQLServerPath", "SQLDatabaseName")

Latest revision as of 16:18, 17 June 2016

APIWiki.png


Member of: SynthesisAPI.Repository


Connects to a SQL Server repository. Returns a Boolean value; when true, indicates a successful connection to the repository.

Syntax

.ConnectToSQLRepository(ServerName, DatabaseName, UseImpersonation, ImpersonateDomain, ImpersonateUsername, ImpersonatePassword)

Parameters

ServerName

Required. String. The name of the SQL Server.

DatabaseName

Required. String. The name of the database.

UseImpersonation

Optional. Boolean. Indicates whether the database requires impersonation. Default value = False.

ImpersonateDomain

Optional. String. The domain for the impersonation.

ImpersonateUsername

Optional. String. The account username for the impersonation.

ImpersonatePassword

Optional. String. The account password for the impersonation.


Example

VB|VB.NET

Dim MyRepository As New Repository
MyRepository.ConnectToSQLRepository("MyServer", "MyDatabase")