ONeils API – Moving to version 5.01

I do quite a lot of programming work around the edges of ONeil RS-SQL records management system. I write reports and process data extracts using SQL tools like reporting services, or integration services.

However, there is one job that comes up every couple of years.
Aligning the old code to the new API.

I was never a c++ programmer. I skipped from C, to C# without hitting that awful thing in the middle.

Things always change. The original code, used unmanaged memory and literally byte arrays to pass data. So, when a record grew a new field, the required bytes had to be aligned.

This time around they’ve changed the way the login process works, but forgotten to include this code in their API examples.

If you’re using the ONeil API for C#.net using the old unmanaged methods, you’re really going to need this:
namespace ONeilSoft.RSSQLAPI
{
public class APIImports
{
#region Login\free\get last error
[DllImport(“RSSQLAPI.DLL”, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
public static extern UInt32 RSSQLClientLogin(
string userCode,
string userPassword,
string recordCenterGuid,
string loginOptions,
string configServer,
string configDatabase);
.
.
.
}
}

New style / Managed

I have to say, the new style code is looking much better. Unfortuantely, there are still some gaps in the functions available, but it really is now in the realms of normal human programming.