Thursday 18 September 2008

Reading and Updating Departments in Sage

In Sage, products are often assigned to Departments, for example, a food wholesaler might have a department for frozen foods, and one for fresh foods.

Reading and updating departments in Sage via Sage Data Objects is easy, and here's how.

Reading departments:

Dim IDepartment As SageDataObject50.Department

Dim strDescription As String

IDepartment = DirectCast(ws50.CreateObject("DepartmentData"), SageDataObject50.Department)

Dim i As Int16

For i = 0 To 100

IDepartment.Read(i)

strDescription = IDepartment.Fields.Item("NAME").Value.ToString()

Me.lvDepartments.Items.Add(strDescription)

Next


To update them, you just use the write(int) method.


Dim IDepartment As SageDataObject50.Department

Dim strDescription As String

IDepartment = DirectCast(ws50.CreateObject("DepartmentData"), SageDataObject50.Department)

Dim i As Int16

For i = 0 To 100

IDepartment.Fields.Item("NAME").Value = "RESET"

IDepartment.Write(i)

Next


Tuesday 2 September 2008

Read/Write ODBC connection for Sage

Sage ships with a read only ODBC connection, which is useful for doing linked-server joins with SQL server, or similar databases. Or, a quick way to import into Excel, for instance. However, the main limitation of this, is that it is only read-only, you cannot change any data within Sage.

A company we were speaking to offer a ODBC SDK on a 15 day trial basis, and we'd be interested in hearing from anyone who can integrate our component with this SDK to create a read/write ODBC connection with Sage.

Here's the link to the ODBC SDK
http://www.datadirect.com/downloads/registration/sdk_eval/index.ssp