Previous Topic

Next Topic

Inhoudsopgave

Book Index

Creating Application Object and Database Connection

Description

Application Object

Before you can use the Document Link, you have to create an Application Object. The Application object is the central portal for Isah document functionality. First of all, add a reference to the Document Link API in the Visual Basic project. Select "Isah Document Link 4.5 Library" on the COM tab of the References in the project settings. You can now use functionality of the Document Link API.

Use the code below to create the Application object. By placing the object in a global variable you can use the object in other functions.

Dim oDMLink As IDMLink.Application

Set oDMLink = new IDMLink.Application

Integration Server

By creating an Application object an Integration Server object will be created and also there will be a check for licenses for both the applications. The Document Link only functions when the Integration server is present. The Integration Server is available via the Document Link API.

Database Connection

Almost all Document Link functionality makes use of the Isah database and therefore an active database connection is required. The user must be logged in (in Isah and the database) to determine his rights. Apart from the Connect and Disconnect methods the Document Link has no login functionality, so the Connection object of the Integration Server should be used for logging in. The login can be performed with or without a login form: either the login data can be entered in advance (for example in case of automated processes such as updating all document statuses from a Document Management System) or entered by the user. You can find an example of both situations below. When the login data are correct and valid the database connection will be created.

Logging in Without a Login Form

oDMLink = New IDMLink.Application

oDMLink.ERPLink.Connection.DatabaseAliasname = "DemoDB"

oDMLink.ERPLink.Connection.Username = "Guest"

oDMLink.ERPLink.Connection.Password = ""

oDMLink.ERPLink.Connection.ShowLoginDialog = False

oDMLink.Connect()

Logging in With a Login Form

oDMLink = New IDMLink.Application

oDMLink.Connect()

The default value for ShowLoginDialog is TRUE, so in the example above the login form will be showed in which the user can enter Administration, Name and Password. When the user clicks the OK button, the database connection will be created. You can check this by retrieving the Connected property.

If oDMLink.ERPLink.Connected then

MsgBox "Connected with the database."

Else

MsgBox "No connection with the database."

End If