Repository.ConnectToSQLRepository: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
{{Template:APIClass|Repository Class|Repository}}
{{Template:APIClass|Repository Class|Repository}}
{{Template:Repository.ConnectToSQLRepository.Cmt}} {{Template:BooleanReturn.Cmt}}
{{Template:Repository.ConnectToSQLRepository.Cmt}}  


== Syntax ==
== Syntax ==
*ConnectToSQLRepository( ServerName {{APIPrefix|As String}}, DatabaseName {{APIPrefix|As String}}, {{APIPrefix|Optional}} UseImpersonation {{APIPrefix|As Boolean}} = False , {{APIPrefix|Optional}} ImpersonateDomain {{APIPrefix|As String}} = "", {{APIPrefix|Optional}} ImpersonateUsername {{APIPrefix|As String}} = "" , {{APIPrefix|Optional}} ImpersonatePassword {{APIPrefix|As String}} = "") {{APIPrefix|As Boolean}}
*ConnectToSQLRepository({{APIPrefix|ByVal}} ServerName {{APIPrefix|As String}}, {{APIPrefix|ByVal}} {{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}}


Parameters
Parameters
Line 17: Line 17:


:''ImpersonatePassword'': The Password for the impersonation.
:''ImpersonatePassword'': The Password for the impersonation.
{{Template:BooleanReturn.Cmt}}


== Usage Example ==
== Usage Example ==
Line 24: Line 26:
    
    
  {{APIComment|'Connect to the Synthesis repository.}}
  {{APIComment|'Connect to the Synthesis repository.}}
   Dim Success As Boolean = False
   Dim Success As Boolean
   Success = MyRepository.ConnectToSQLRepository("SQLServerPath", "SQLDatabaseName")
   Success = MyRepository.ConnectToSQLRepository("SQLServerPath", "SQLDatabaseName")

Revision as of 17:23, 20 May 2015


Connects to an MS SQL repository.

Syntax

  • ConnectToSQLRepository(ByVal ServerName As String, ByVal ByVal DatabaseName As String, Optional ByVal UseImpersonation As Boolean = False , Optional ByVal ImpersonateDomain As String = "", Optional ByVal ImpersonateUsername As String = "" , Optional ByVal ImpersonatePassword As String = "") As Boolean

Parameters

ServerName: The server file path for the SQL repository.
DatabaseName: The database name of the repository.
UseImpersonation: Whether the database requires impersonation.
ImpersonateDomain: The domain for the impersonation.
ImpersonateUsername: The User Name for the impersonation.
ImpersonatePassword: The Password for the impersonation.

Returns True if successful, otherwise returns False.

Usage Example

 'Declare a new repository connection object. 
 Dim MyRepository As New Repository
 
 'Connect to the Synthesis repository. 
 Dim Success As Boolean
 Success = MyRepository.ConnectToSQLRepository("SQLServerPath", "SQLDatabaseName")