Switch to: V12V11V10V9V8V7V6V5

VConnection Class: Connection Methods

VConnection.Open()

Declaration:

Open()

Description:

Establishes a connection to a Valentina Server.

Errors:

  • Wrong user name
  • Wrong password
  • The user is not an administrator
  • Connection cannot be established

Example:

dim connection as VConnection
connection = new VConnection( "localhost", "sa", "sa" )
 
connection.Open()

VConnection.Close()

Declaration:

Close()

Description:

Closes the connection with the server. After this any objects created in the scope of this connection (VDatabase, VTable, VCursor, … ) become invalid and you should not try to use it, otherwise most probably you will get ERR_STREAM_XXXX error.

NOTE: VConnection.Open() and .Close() methods are similar to Init/ShutDown methods in means that you cannot reuse any objects created between these calls in the scope of this connection. Instead on the next Open() you should create all objects again starting from VDatabase object.

Example:

dim connection as VConnection
connection = new VConnection( "localhost", "sa", "sa" )	
connection.Open()
...
connection.Close()

VConnection.UseSSL()

Declaration:

UseSSL()

Description:

You should call this method right BEFORE VConnection.Open() method if you want to establish a secure connection to Valentina Server. Note that VServer should listen for SSL port to be able accept such connection.

Example:

dim connection as VConnection
connection = new VConnection( "localhost", "sa", "sa" )	
connection.UseSSL()
connection.Open()
...
connection.Close()

VConnection.UseNotifications()

Declaration:

UseNotifications()

Description:

You should call this method right BEFORE VConnection.Open() method if you want to enable usage of notifications channels in Valentina Server for this connection.

Example:

dim connection as VConnection
connection = new VConnection( "localhost", "sa", "sa" )	
connection.UseNotifications()
connection.Open()
...
connection.Close()