SAapi Object : CreateProjectCopy Method |
The type of database. Use the following constants or their values:
Specifies flags that control project creation. Flags can be ORed together to specify multiply options.
Use the values from the SA_COPY_PROJECT_OPTIONS Enumeration.
Specifies flags that control project creation. Flags can be ORed together to specify multiply options. Use the values from the SA_PROJECT_CREATION_OPTIONS Enumeration.
Visual Basic |
---|
Public Function CreateProjectCopy( _ ByVal DomainName As String, _ ByVal NewProjectName As String, _ ByVal NewDbType As Integer, _ ByVal SourceDomainName As String, _ ByVal SourceProjectName As String, _ ByVal DbServerName As String, _ ByVal AdminUser As String, _ ByVal AdminPassword As String, _ ByVal TableSpace As String, _ ByVal TempTableSpace As String, _ ByVal TableSpaceSize As Long, _ ByVal TempTableSpaceSize As Long, _ ByVal CopyOptions As Long, _ ByVal CreationOptions As Long _ ) As String |
The type of database. Use the following constants or their values:
Specifies flags that control project creation. Flags can be ORed together to specify multiply options.
Use the values from the SA_COPY_PROJECT_OPTIONS Enumeration.
Specifies flags that control project creation. Flags can be ORed together to specify multiply options. Use the values from the SA_PROJECT_CREATION_OPTIONS Enumeration.
On success, returns an XML string containing the project properties.
The properties of the XML return string:
Private Sub CreateProjectCopy() 'The following Visual Basic example creates a new project ' in an existing domain by copying the customization ' requirements and users from an existing project. Dim sDomainName As String Dim sNewProjectName As String Dim sProjectName As String Dim sServerName As String Dim CreateOptions As Long Dim CopyOptions As Long Dim sReply As String On Error GoTo err sDomainName = "MyNewDomain" sNewProjectName = "MyBrandNewProject" sProjectName = "MyNewProject" sServerName = "http://myserver/qcbin" 'Disconnect all users from Project Call m_SAClient.DisconnectProject _ (sDomainName, sProjectName) ' Deactivate source project Call m_SAClient.DeactivateProject _ (sDomainName, sProjectName) ' Copy from source project to new project CreateOptions = SA_ACTIVATE_NEW_PROJECT CopyOptions = SA_COPY_PROJECT_CUSTOMIZATION _ + SA_COPY_PROJECT_REQUIREMENTS _ + SA_COPY_PROJECT_USERS_AND_GROUPS sReply = m_SAClient.CreateProjectCopy _ (sDomainName, sNewProjectName, SA_ORACLE_DB_TYPE, _ sDomainName, sProjectName, _ sServerName, "admin", "swordfish", _ "", "", 0, 0, _ CopyOptions, CreateOptions) ' Reactivate source project Call m_SAClient.ActivateProject _ (sDomainName, sProjectName) MsgBox sReply Exit Sub err: MsgBox "Program failed:" + err.Description End Sub