Repository.ConnectToRepository: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
No edit summary
mNo edit summary
 
(43 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{Template:APIClass|Repository Class|Repository}}
{{Template:API}}{{Template:APIBreadcrumb|.[[Repository Class|Repository]]}}
{{APIComment|Connects to any (MS Access, MS SQL or Oracle) repository.}}<br>
{{APIComment|If the extension of the file is 'rserp' then it connects to the enterprise database described in the file.}}<br>
{{APIComment|Otherwise MS Access repository is assumed.}}<br>


== Property Syntax==
{{APIPrefix|Public Function}}
{{APIName|ConnectToRepository(}}
{{APIPrefix|ByVal}}
{{APIName|FileName}}
{{APIPrefix|As String}}
{{APIName|)}}
{{APIPrefix|As Boolean}}<br>
{{APIComment|Connects to any (MS Access, MS SQL or Oracle) repository. If the extension of the file is 'rserp' then it connects to the enterprise database described in the file. Otherwise MS Access repository is assumed.}}


<onlyinclude>Connects to a standard or enterprise repository. Returns a '''Boolean''' value; when true, indicates a successful connection to the repository.</onlyinclude>


== Parameters ==
== Syntax ==
'''FileName'''
'''.ConnectToRepository'''(''FileName'')
The file path for the Synthesis Repository to connect.


== Usage Example ==
=== Parameters ===
''FileName''
:Required. String. The complete path to the Synthesis repository. If the file extension is not specified, it assumes that the file is a standard repository.


{{APIComment|Declare a new repository connection class.}}
        Private WithEvents MyRepository As New Repository


{{APIComment|Connect to the Synthesis repository.}}
== Example ==
        Dim Success As Boolean = False
This example assumes that a file called "RSRepository1.rsr10" exists in the C: drive. The code ignores the return value.
        Success = MyRepository.ConnectToRepository("RepositoryFileNamePath")
 
'''VBA|VB.NET'''
{{APIPrefix|Dim}} MyRepository {{APIPrefix|As New}} Repository
MyRepository.ConnectToRepository({{APIString|"C:\RSRepository1.rsr10"}})

Latest revision as of 21:53, 13 November 2015

APIWiki.png


Member of: SynthesisAPI.Repository


Connects to a standard or enterprise repository. Returns a Boolean value; when true, indicates a successful connection to the repository.

Syntax

.ConnectToRepository(FileName)

Parameters

FileName

Required. String. The complete path to the Synthesis repository. If the file extension is not specified, it assumes that the file is a standard repository.


Example

This example assumes that a file called "RSRepository1.rsr10" exists in the C: drive. The code ignores the return value.

VBA|VB.NET

Dim MyRepository As New Repository
MyRepository.ConnectToRepository("C:\RSRepository1.rsr10")