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 the session object

MySession = New CTSession(SESSION_TYPE.CTREE_SESSION)

' allocate the table objects

tableCustOrdr = New CTTable(MySession)

tableOrdrItem = New CTTable(MySession)

tableItemMast = New CTTable(MySession)

tableCustMast = New CTTable(MySession)

' allocate the record objects

recordCustOrdr = New CTRecord(tableCustOrdr)

recordOrdrItem = New CTRecord(tableOrdrItem)

recordItemMast = New CTRecord(tableItemMast)

recordCustMast = New CTRecord(tableCustMast)

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