SAGE DATA OBJECTS > C#


sage line 50 sage line 100 sage line 50 training 50 line pos sage sage line 50 financial controller 100 line sage software 50 line sage software training 50 accounting line sage software sage line 50 software sage line sage line 50 training course 50 controller financial line sage v12 sage line 50 note 100 50 line sage 50 cheap discount line sage Searches done in April 2006 Count Search Term sage software sage accounting software sage payroll software sage software inc 100 line sage software 50 line sage software training act sage software sage payroll software training sage software training 50 accounting line sage software sage software mas 90 sage line 50 software accounting sage sales software sage payroll software course sage account software discount sage software sage accounting software uk sage book keeping software form sage software sage line50 software C# .NET Visual Basic .NET VB.NET Component OCX DLL Return to Sage Data Objects for .NET homepage How to use the new memo property - Example

How to use the new Memo Property

To use the new SDO in Visual Basic you must add it to the list of References so that Visual Basic knows what the Sage Line 50 Data Objects are when you refer to them.

Follow these steps:

In Visual Basic 4 (32-bit)

Choose the Tools menu followed by References.

Find the 'Sage Data Objects 5.0' item, check it and click OK.

In Visual Basic 5/6

Choose the Project menu followed by References.

Find the 'Sage Data Objects 5.0' item, check it and click OK.

If you cannot see the 'Sage Data Objects 5.0' item in the References list, choose Browse and locate the directory where the SDOENG50.DLL and SDOENG50.TLB files are located. Select the SDOENG50.TLB file and click OK. This will add the "Sage Data Objects" to the Reference list in Visual Basic and at the same time register the objects in the Windows registry.

Visual Basic Code Example

This example demonstrates the new Memo property on a customer record in the sale ledger.
Note that this could have been on the purchase ledger, nominal ledger or stock

Dim Engine As SageDataObject50.SDOEngine            'Engine
Dim WS As SageDataObject50.WorkSpace                'Workspace
Dim CustomerObj As SageDataObject50.SalesRecord     'Sales record object

'Init the objects
Set Engine = New SageDataObject50.SDOEngine
Set WS = Engine.Workspaces.Add("AC_Connection")

'Set connect path - note should finish ACCDATA\
WS.Connect "D:\L50\SAGEWIN\V5\ACCDATA\", "manager", "", "XYZ123"

'Init the sales record object
Set CustomerObj = WS.CreateObject("SalesRecord")

'For this example we will find the first customer
CustomerObj.MoveFirst

'*****************************************************************************************
'First we will write a new memo to an existing customer
'*****************************************************************************************

'We must use Edit if we are going to use Update later and the customer already exists
'Note we could be using AddNew to create a new customer
If CustomerObj.Edit() Then
    'Now we can add the text for the memo
    CustomerObj.memo = "Memo text for first customer"
    'Finally for the memo to be saved to the customer we need to call update
    If CustomerObj.Update() Then
        MsgBox "done memo"
    End If
End If

'******************************************************************************************
'Now we will read an existing memo
'We will now assume that there is a second customer in Line50 and that they have
'already got memo text entered against them
'******************************************************************************************

'Move to the next customer
CustomerObj.MoveNext
'return the text of their memo back to a message box
MsgBox CustomerObj.memo

'And last we destroy the objects and disconnect from Line50
Set CustomerObj = Nothing
WS.Disconnect
Set WS = Nothing
Set Engine = Nothing