Mimer Data Provider

MimerConnection.ConnectionString Property

Gets or sets the string that defines the information needed to connect to a database server.

[Visual Basic]
Public Property ConnectionString As String _
    Implements IDbConnection.ConnectionString
[C#]
public string ConnectionString { get; set; }
[C++]
public: __property String* get_ConnectionString();
public: __property void set_ConnectionString(String* );
[JScript]
public function get ConnectionString() : String
public function set ConnectionString(String);

Property Value

The connection string that includes the parameters needed to establish the initial connection. Please note that Database must be specified. The default value is an empty string.

Implements

IDbConnection.ConnectionString

Remarks

The following keywords are support by the Mimer Data Provider:

KeyWordRemarks
Database The name of the database server to connect to. You must always specify this keyword.
User ID The database user to connect to. The User Id is not used if Integrated Security is selected. Otherwise User Id is required.
Password The password for the User ID. Ignored if Integrated Security is used.
Integrated Security If set to true, the system will try to use the current Windows user to login. This type of login succeeds if there is an ident of type OS_USER with the same name as the Windows user. If keyword is not specified or set to false, User Id and Password is used to login to the database server.
Persist Security Info After successful login the password information is removed from the connection string unless this keyword is set to true.
Node The network node the database server is located on. For protocol tcp this is the TCP/IP node name or IP address.
Protocol The network protocol to use when communicating with the database server. Which protocols are supported are both platform and installation specific.

Protocol tcp, which gives both access to local and remote servers, is always supported. tcp may not be combined with the keyword Integrated security.

Protocol local is the most efficient protocol to use when communicating with a database server on the same machine or device. For the Crossfire environment this protocol is not yet supported. For the .NET Framework and Compact Framework a special library called mimcomm.dll must be accessible for the protocol to be used.

Protocol NamedPipes is currently only supported in the .NET environment. It allows secure network access and also allows IntegratedSecurity to be used over the network.
Service For protocol tcp this is the port number and for protocol NamedPipes this is the name of the database server.

Example

[C#, Visual Basic] The following example logs in to a database server on another node in the network. The user TEST must be defined in the database server (done with the SQL command CREATE IDENT).

[C#]
MimerConnection connection = new MimerConnection();
//
//  Login as the Mimer ident TEST in the database server ExampleDB located on
//  node ExServer using the TCP/IP network protocol
//
connection.ConnectionString = "Database=TESTDB;Protocol=tcp;Node=ExServer;" +
    "User ID=TEST;Password=Testpass";
connection.Open();
try {
    //
    // Do something with the connection...
    //

} finally {
    //
    //   Always close the connection before the connection object goes out of scope
    //
    connection.Close();
}
[Visual Basic]
Dim connection As New MimerConnection
'
'  Login as the Mimer ident TEST in the database server ExampleDB located on
'  node ExServer using the TCP/IP network protocol
'
connection.ConnectionString = "Database=TESTDB;Protocol=tcp;Node=ExServer;" &
    "User ID=TEST;Password=Testpass"
connection.Open()
Try
    '
    ' Do something with the connection...
    '

Finally
    '
    '   Always close the connection before the connection object goes out of scope
    '
    connection.Close()
End Try

[C#, Visual Basic] The following example logs in as the current operating system user in the database server.

[C#]
MimerConnection connection = new MimerConnection();
//
//  Login as the current Windows user in the local database server ExampleDB
//
connection.ConnectionString = "Database=ExampleDB;Integrated Security=true;Protocol=local";
connection.Open();
[Visual Basic]
Dim connection as New MimerConnection
'
'  Login as the current Windows user in the local database server ExampleDB
'
connection.ConnectionString = "Database=ExampleDB;Integrated Security=true;Protocol=local"
connection.Open()

[C++, JScript] No example is available for C++ or JScript. To view a C# example, click the Language Filter button in the upper-left corner of the page.

See Also

MimerConnection Class | Mimer.Data.Client Namespace