IPrimaryMsSqlSPLD.DatabaseOnly

Fore Syntax

DatabaseOnly: String;

Fore.NET Syntax

DatabaseOnly: String;

Description

The DatabaseOnly property determines identifier of the database on the MS SQL server, in which repository data is stored.

Comments

This property is relevant to use if the Microsoft SQL Server 2008 DBMS type is on the server and a user schema is used in database.

The DatabaseOnly property views only database identifier without user schema.

Fore Example

To execute the example, add the Metabase system assembly to the module.

Sub UserProc;
Var
    MbMan: IMetabaseManager;
    MbDefs: IMetabaseDefinitions;
    MbDef: IMetabaseDefinition;
    MsSqlSPLD: IPrimaryMsSqlSPLD;
Begin
    MbMan := MetabaseManagerFactory.Active;
    MbDefs := MbMan.Definitions;
    MbDef := MbDefs.Add;
    MbDef.DriverId := "MSSQL2008";
    MbDef.Id := "Test_MSSQL";
    MbDef.Name := "Test_MSSQL";
    MbDef.Authentication := AuthenticationMode.Password;
    MbDef.SecurityPackage := "STANDARDSECURITYPACKAGE";
    MsSqlSPLD := MbDef.LogonData As IPrimaryMsSqlSPLD;
    MsSqlSPLD.Server := "Test_MS";
    MsSqlSPLD.DatabaseOnly := "DB_Repository";
    MsSqlSPLD.SchemaOnly := "UserSchema";
    MbDef.Save;
End Sub UserProc;

A new description of the repository is created after executing this example. The UserSchema user schema in the specified database is used for connection. The MS SQL Server 2008 DBMS is used on the Test_MS server.

Fore.NET Example

The specified procedure is an entry point for the .NET assembly.

Imports Prognoz.Platform.Interop.Metabase;

Public Shared Sub Main(Params: StartParams);
Var
    MbMan: IMetabaseManager;
    MbDefs: IMetabaseDefinitions;
    MbDef: IMetabaseDefinition;
    MsSqlSPLD: IPrimaryMsSqlSPLD;
    MF: IMetabaseManagerFactory;
Begin
    MF := New MetabaseManagerFactoryClass();
    MbMan := MF.Active;
    MbDefs := MbMan.Definitions;
    MbDef := MbDefs.Add();
    MbDef.DriverId := "MSSQL2008";
    MbDef.Id := "Test_MSSQL1";
    MbDef.Name := "Test_MSSQL1";
    MbDef.Authentication := AuthenticationMode.amPassword;
    MbDef.SecurityPackage := "STANDARDSECURITYPACKAGE";
    MsSqlSPLD := MbDef.LogonData As IPrimaryMsSqlSPLD;
    MsSqlSPLD.Server := "Test_MS";
    MsSqlSPLD.DatabaseOnly := "DB_Repository";
    MsSqlSPLD.SchemaOnly := "UserSchema";
    MbDef.Save();
End Sub;

A new description of the repository is created after executing this example. The UserSchema user schema in the specified database is used for connection. The MS SQL Server 2008 DBMS is used on the Test_MS server.

See also:

IPrimaryMsSqlSPLD