Adding a Record to the Borrower Table

When a Fitch & Mather employee submits a request to check out a library title, a record for that employee is added to the borrower table of the FmLib SQL Server™ database if one does not already exist; if one exists it is updated. The User component in the CML.dll file, written for the previous version of the library application, has a method named UpdateInfoFromExchange that performs this task. User.cls in the code section contains the code for the UpdateInfoFromExchange function. Now that the library application allows submission of critiques, the User component is reused to add and update records for reviewers. When a critique is posted to the LitCrit public folder, script in the Folder_onMessageCreated event instantiates the server-side Critique COM component and calls the BorrowerInfo method.

Set objCritique = CreateObject("LitCrit.Critique")
borrowerNo = objCritique.BorrowerInfo(LDAPString,ServerName)

The BorrowerInfo method in turn instantiates the User component and calls the GetInfoFromTable and UpdateInfoFromExchange methods.

Set oUser = New CML.User
BorrowerNo = oUser.GetInfoFromTable(varValues(4)) 'varvalues(4) = alias
If BorrowerNo = 0 Then
      BorrowerNo = oUser.UpdateInfoFromExchange(Server, varValues(1), varValues(2), varValues(4))
End If

The process of adding a reviewer to the borrower table or updating reviewer information is identical whether the critique is submitted from the browser or from the Outlook interface. This is because the critiques are always posted to the LitCrit public folder and the script that initiates the add or update to the borrower table is fired by an event on the folder. The complete Exchange Event Script file is available in LitCrit_Agent.asp Event Service Script.

Note  All critiques exist briefly in the LitCrit public folder and a borrower record is added to the borrower table or the existing record is updated. If approval is required the content of the message is copied to the ToApprover Outlook form, forwarded to the approver, and the original item is deleted from the folder. When a critique is rejected, it does not reappear in the folder and the database record for the critique is deleted. The FmLib database may therefore have borrower records for persons who have no critique in the Critique table and have never requested to check out a title from the library.