Repository.Project.SetCurrentProject: Difference between revisions

From ReliaWiki
Jump to navigation Jump to search
m (Protected "Repository.SetCurrentProject" ([edit=sysop] (indefinite) [move=sysop] (indefinite)) [cascading])
No edit summary
 
(21 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Template:APIClass|Repository Class|Repository}}
{{Template:API}}{{Template:APIBreadcrumb|.[[Repository Class|Repository]]}}
Sets the current project to the specified Project ID.  Returns the Boolean status.


== Method Syntax==
{{APIName|'''SetCurrentProject'''(}}
{{APIPrefix|ByVal}}
{{APIName|ProjectID}}
{{APIPrefix|As Integer}}
{{APIName|)}}
{{APIPrefix|As Boolean}}<br>
{{APIComment|Opens (sets as current) a project with the specified ID. If 0 is passed, a fist available project will be set as current.}}


== Parameters ==
<onlyinclude>Sets the current (active) project for the repository. Returns a '''Boolean''' value; when true, indicates a successful connection to that project.</onlyinclude>
'''ProjectID'''
Set the current project to this ID.


== Usage Example ==
== Syntax ==
{{APIComment|Declare a new repository connection class.}}
'''.Project.SetCurrentProject'''(''ProjectID'')
        Private WithEvents MyRepository As New Repository


{{APIComment|Connect to the Synthesis repository.}}
=== Parameters ===
        Dim Success As Boolean = False
''ProjectID''
        Success = MyRepository.ConnectToRepository("RepositoryFileNamePath")
:Required. Integer. The ID number of the project.


{{APIComment|Set the current project to the desired ID.}}
 
        Dim IDChangeSuccess As Boolean = False
== Example ==
        If MyRepository.SetCurrentProject(1) Then
 
          IDChangeSuccess = True
'''VBA|VB.NET'''
        End If
{{APIComment|'Declare a new Repository object and connect to a Synthesis repository.}}
  {{APIPrefix|Dim}} MyRepository {{APIPrefix|As New}} Repository
  MyRepository.ConnectToAccessRepository({{APIString|"C:\RSRepository1.rsr10"}})
 
{{APIComment|'Set the first available project in the repository as the current project.}}
  MyRepository.Project.SetCurrentProject(1)

Latest revision as of 15:29, 9 June 2016

APIWiki.png


Member of: SynthesisAPI.Repository


Sets the current (active) project for the repository. Returns a Boolean value; when true, indicates a successful connection to that project.

Syntax

.Project.SetCurrentProject(ProjectID)

Parameters

ProjectID

Required. Integer. The ID number of the project.


Example

VBA|VB.NET

 'Declare a new Repository object and connect to a Synthesis repository. 
  Dim MyRepository As New Repository
  MyRepository.ConnectToAccessRepository("C:\RSRepository1.rsr10")
 
 'Set the first available project in the repository as the current project. 
  MyRepository.Project.SetCurrentProject(1)