Repository.ConnectToSQLRepository: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(19 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Template:APIClass|Repository Class|Repository}}
{{Template:API}}{{Template:APIBreadcrumb|.[[Repository Class|Repository]]}}
Connects to a SQL repository.
== Method Syntax ==
{{APIName|'''ConnectToSQLRepository'''(}}
{{APIPrefix|ByVal}}
{{APIName|ServerName}}
{{APIPrefix|As String, ByVal}}
{{APIName|DatabaseName}}
{{APIPrefix|As String, Optional ByVal}}
{{APIName|UseImpersonation}}
{{APIPrefix|As Boolean}}
=
{{APIPrefix|False, Optional ByVal}}
{{APIName|ImpersonateDomain}}
{{APIPrefix|As String}}
=
{{APIName|"",}}
{{APIPrefix|Optional ByVal}}
{{APIName|ImpersonateUsername}}
{{APIPrefix|As String}}
=
{{APIName|"",}}
{{APIPrefix|Optional ByVal}}
{{APIName|ImpersonatePassword}}
{{APIPrefix|As String}}
=
{{APIName|"")}}
{{APIPrefix|As Boolean}}<br>
{{APIComment|Connects to an MS SQL repository.}}


== Parameters ==
'''ServerName'''
The server file path for the SQL Repository.


'''DatabaseName'''
<onlyinclude>Connects to a SQL Server repository. Returns a '''Boolean''' value; when true, indicates a successful connection to the repository.</onlyinclude>
The Database name of the Synthesis Repository to connect.


'''UseImpersonation'''
== Syntax ==
The database requires impersonation.
'''.ConnectToSQLRepository'''(''ServerName'', ''DatabaseName'', ''UseImpersonation'', ''ImpersonateDomain'', ''ImpersonateUsername'', ''ImpersonatePassword'')


'''ImpersonateDomain'''
===Parameters===
The domain for the impersonation.
''ServerName''
:Required. String. The name of the SQL Server.  


'''ImpersonateUsername'''
''DatabaseName''  
The User Name for the impersonation.
:Required. String. The name of the database.


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


== Usage Example ==
''ImpersonateDomain''
:Optional. String. The domain for the impersonation.


{{APIComment|Declare a new repository connection class.}}
''ImpersonateUsername''
        Private WithEvents MyRepository As New Repository
:Optional. String. The account username for the impersonation.


{{APIComment|Connect to the Synthesis repository.}}
''ImpersonatePassword''
        Dim Success As Boolean = False
:Optional. String. The account password for the impersonation.
        Success = MyRepository.ConnectToSQLRepository("SQLServerPath", "SQLDatabaseName")
 
 
==Example==
'''VB|VB.NET'''
{{APIPrefix|Dim}} MyRepository {{APIPrefix|As New}} Repository
MyRepository.ConnectToSQLRepository({{APIString|"MyServer"}}, {{APIString|"MyDatabase"}})

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")