Product Documentation

c-treeDB API for VB.Net

Previous Topic

Next Topic

Init

First we need to open a connection to a database by providing the FairCom Database Engine with a user name, password and the database name.

Below is the code for Initialize():

' Initialize()

'

' Perform the minimum requirement of logging onto the c-tree Server

Sub Initialize()

Console.WriteLine("INIT")

Try

' allocate objects

MySession = New CTSession(SESSION_TYPE.CTREE_SESSION)

MyTable = New CTTable(MySession)

MyRecord = New CTRecord(MyTable)

Catch E As CTException

Handle_Exception(E)

End Try

Try

' connect to server

Console.WriteLine(ControlChars.Tab + "Logon to server...")

MySession.Logon("FAIRCOMS", "", "")

Catch E As CTException

Handle_Exception(E)

End Try

End Sub

TOCIndex