Repository.ConnectToSQLRepository: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
{{Template:APIClass|Repository Class|Repository}}
{{Template:APIBreadcrumb|9|Repository}}
{{Template:Repository.ConnectToSQLRepository.Cmt}}
{{Template:API}}
 
Connects to a SQL server repository that you specify. Returns a '''Boolean''' value; when true, indicates a successful connection to the repository.  


== 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}}
''object''.'''ConnectToSQLRepository(''ServerName'', ''DatabaseName'', ''UseImpersonation'', ''ImpersonateDomain'', ''ImpersonateUsername'', ''ImpersonatePassword'')'''
 
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.
where ''object'' is a variable that represents a Repository object.


{{Template:BooleanReturn.Cmt}}
===Parameters===
{| {{APITable}}
|-
|ServerName{{APIParam|Required}}||'''String'''. The server file path for the SQL database.
|-
|DatabaseName{{APIParam|Required}}||'''String'''. The name of the database.
|-
|UseImpersonation{{APIParam|Optional}}||'''Boolean'''. When true, indicates that the database requires SQL impersonation. Default value is false.
|-
|ImpersonateDomain{{APIParam|Optional}}||'''String'''. The domain for the impersonation.
|-
|ImpersonateUsername{{APIParam|Optional}}||'''String'''. The account username for the impersonation.
|-
|ImpersonatePassword{{APIParam|Optional}}||'''String'''. The account password for the impersonation.
|}


== Usage Example ==


  {{APIComment|'Declare a new repository connection object.}}
==Example==
  Dim MyRepository As New Repository
This example assumes that a SQL database named "MyEnterprise" exists in the C: drive. This code sample ignores the return value.
 
'''VB|VB.NET'''<br>
{{APIComment|'Connect to the Synthesis repository.}}
  {{APIPrefix|Dim}} MyRepository {{APIPrefix|As New}} Repository
  Dim Success As Boolean
MyRepository.ConnectToSQLRepository({{APIString|"C:\Program Files\Microsoft SQL Server\"}}, {{APIString|"MyEnterprise"}})
  Success = MyRepository.ConnectToSQLRepository("SQLServerPath", "SQLDatabaseName")

Revision as of 16:13, 13 July 2015

Member of: SynthesisAPI9Repository

APIWiki.png



Connects to a SQL server repository that you specify. Returns a Boolean value; when true, indicates a successful connection to the repository.

Syntax

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

where object is a variable that represents a Repository object.

Parameters

Name Description
ServerNameborder="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse; text-align: left; cellborder"
Name Status String. The server file path for the SQL database.
DatabaseNameborder="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse; text-align: left; cellborder"
Name Status String. The name of the database.
UseImpersonationborder="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse; text-align: left; cellborder"
Name Status Boolean. When true, indicates that the database requires SQL impersonation. Default value is false.
ImpersonateDomainborder="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse; text-align: left; cellborder"
Name Status String. The domain for the impersonation.
ImpersonateUsernameborder="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse; text-align: left; cellborder"
Name Status String. The account username for the impersonation.
ImpersonatePasswordborder="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse; text-align: left; cellborder"
Name Status String. The account password for the impersonation.


Example

This example assumes that a SQL database named "MyEnterprise" exists in the C: drive. This code sample ignores the return value.

VB|VB.NET
Dim MyRepository As New Repository MyRepository.ConnectToSQLRepository("C:\Program Files\Microsoft SQL Server\", "MyEnterprise")