I attach the include file as I have it sofar and the calling program: always get the error. 
Code: Select all
;SQLiteningPB.inc
;==========================================================================
; Generated with PureDLLHelper, Copyright ©2012 by Thomas <ts-soft> Schulz
;************************************************************************
;Functions from SQliteningU.dll
;************************************************************************
;===========================<[ Field Get ]>============================
;Declare Sub      sluF lib "SQLiteningU.Dll" alias "sluF" ( _
                                ; byval ColumnNumber As Long, _
                                ; byval FieldValue As Long, _
                                ; byref SizeOfFieldValue As Long, _
                                ; byval SetNumber As Long)
;   FieldValue is a pointer to the memory which will receive the field value.
;              A Null (hex ;00') will be added to end.
;   SizeOfFieldValue is both passed and returned. Pass the size of FieldValue.
;                    It must be at least the size of the returning field value + 1.
;                    The actual length of the returing field value is returned.
;                    If the passed size is too small then error -13 will be raised
;                    and the returning length will be set to -1.
Prototype  sluF(ColumNumber.l, *FieldValue, *SizeOfField, SetNumber.l = 0)
;==========================================================================
;============================<[ Get Row ]>=============================
;Declare Function sluGetRow lib "SQLiteningU.Dll" alias "sluGetRow" ( _
                                 ;byval SetNumber As Long, _
                                ; byval ModChars As Long) As Long
;   ModChars is a pointer to a null-terminated string. If not needed you
;            may pass a zero.
Prototype  sluGetRow(SetNumber.l = 0, ModChars.p-ascii = 0)
;==========================================================================
;==============================<[ Open ]>==============================
;Declare Function sluOpen lib "SQLiteningU.Dll" alias "sluOpen" ( _
                                ; byval FileName As Long, _
                                ; byval ModChars As Long) As Long
;   FileName is a pointer to a null-terminated string. If not needed you
;            may pass a zero.
;   ModChars is a pointer to a null-terminated string. If not needed you
;            may pass a zero.
Prototype  sluOpen(FileName.p-ascii = 0 , ModChars.p-ascii = 0)
;==========================================================================
;;;==============================<[ Sel ]>===============================
;Declare Function sluSel lib "SQLiteningU.Dll" alias "sluSel" ( _
                                ; byval Statement As Long, _
                                ; byval SetNumber As Long, _
                                ; byval ModChars As Long) As Long
;   Statement is a pointer to a null-terminated string.
;   ModChars is a pointer to a null-terminated string. If not needed you
;            may pass a zero.
Prototype  sluSel(Statement.p-ascii, SetNumber.l = 0, ModChars.p-ascii = 0)
;==========================================================================
;'==============================<[ Exe ]>===============================
;Declare Function sluExe lib "SQLiteningU.Dll" alias "sluExe" (_
 ;                                byval Statement As Long, _
 ;                                byval ModChars As Long) As Long
;   Statement is a pointer to a null-terminated string.
;   ModChars is a pointer to a null-terminated string. If not needed you
;            may pass a zero.
Prototype  sluExe(Statement.p-ascii,  ModChars.p-ascii = 0)
;==========================================================================
;============================<[ Sel Str ]>=============================
;Declare Sub sluSelStr lib "SQLiteningU.Dll" alias "sluSelStr" ( _
 ;                                byval Statement As Long, _
  ;                               byval ModChars As Long, _
   ;                              byval FieldsAndRows As Long, _
    ;                             byref SizeOfFieldsAndRows As Long)
;   Statement is a pointer to a null-terminated string.
;   ModChars is a pointer to a null-terminated string. If not needed you
;            may pass a zero.
;   FieldsAndRows is a pointer to the memory which will receive the fields
;                 and rows. The fields and rows are returned as a $VT:$BS
;                 delimited text string.
;   SizeOfFieldsAndRows is both passed and returned. Pass the size of
;                       FieldsAndRows. It must be at least the size of
;                       the returning fields and rows. The actual length
;                       of the returing fields and rows is returned.
;                       If the passed size is too small then the returning
;                       length will be set to -1.
    Prototype  sluSelStr(Statement.p-ascii, ModChars.p-ascii , *FieldsAndRows.Ascii, *SizeOfFieldsAndRows.Long)
    ;==========================================================================
    
;=====================<[ Get Table Column Names ]>=====================
;Declare Sub      sluGetTableColumnNames lib "SQLiteningU.Dll" alias "sluGetTableColumnNames" ( _
 ;                                byval TableName As Long, _
  ;                               byval ColumnNames As Long, _
   ;                              byref SizeOfColumnNames As Long)
;   TableName is a pointer to a null-terminated string.
;   ColumnNames is a pointer to the memory which will receive the column
;               names. The names are returned as a delimited text string
;               which is $NUL seperated.
;   SizeOfColumnNames is both passed and returned. Pass the size of ColumnName.
;                     It must be at least the size of the returning column names.
;                     The actual length of the returing column names is returned.
;                     If the passed size is too small then the returning length
;                     will be set to -1.   
Prototype sluGetTableColumnNames(TableName.p-ascii, *colName.ascii, *SizeOfColumnName.Long)
;==========================================================================
;'===========================<[ Get Error ]>============================
;Declare Sub      sluGetError lib "SQLiteningU.Dll" alias "sluGetError" ( _
 ;                                byval Error As Long, _
  ;                               byref SizeOfError As Long)
;   Error is a pointer to the memory which will receive the field value.
;              A Null (hex '00') will be added to end.
;   SizeOfError is both passed and returned. Pass the size of Error.
;               It must be at least the size of the returning error + 1.
;               The actual length of the returing error is returned.
;               If the passed size is too small then the returning length
;               will be set to -1.
Prototype sluGetError(*buffer.Ascii, *bufferLen.Long)
;==========================================================================
;============================<[ Connect ]>=============================
;Declare Function sluConnect lib "SQLiteningU.Dll" alias "sluConnect" (_
 ;                                byval Server As Long, _
  ;                               byval Port As Long, _
   ;                              byval ModChars As Long, _
    ;                             byval OutData As Long, _
     ;                           byref SizeOfOutData As Long) As Long
;   Server is a pointer to a null-terminated string.
;   ModChars is a pointer to a null-terminated string. If not needed you
;            may pass a zero.
;   DataOut is a pointer to the returning out data. If not needed you
;           may pass a zero.
;   SizeOfOutData is both passed and returned. Pass the size of OutData.
;                 It must be at least the size of the returning out data.
;                 The actual length of the returing out data is returned.
;                 If the passed size is too small then the returning length will
;                 be set to -1.
    Prototype  sluConnect(Server.p-ascii=0, Port.l=0, modChars.p-ascii=0, *outData=0, *outDataLen.Long=0)
    ;==========================================================================
    
 ;========================<[ Set Process Mods ]>========================
;Declare Sub      sluSetProcessMods lib "SQLiteningU.Dll" alias "sluSetProcessMods" ( _
 ;                                byval ModChars As Long)
 ;   ModChars is a pointer to a null-terminated string. 
 Prototype  sluSetProcessMods(ModChars.p-ascii)
;=======================================================================  
 ;************************************************************************
;Functions from SQlitening.dll
;************************************************************************
;'========================<[ Get Column Count ]>========================
;Declare Function sluGetColumnCount lib "SQLitening.Dll" alias "slGetColumnCount" ( _
 ;                                byval SetNumber As Long) As Long
;   Calls SQLitening.Dll directly.
Prototype  slGetColumnCount(SetNumber.l = 0)
;==========================================================================
;=============================<[ Close ]>==============================
;Declare Sub      sluClose lib "SQLitening.Dll" alias "slClose"
;'   Calls SQLitening.Dll directly.
Prototype  slClose()
;========================================================================
;========================<[ Get Error Number ]>========================
;Declare Function sluGetErrorNumber lib "SQLitening.Dll" alias "slGetErrorNumber" () As Long
;   Calls SQLitening.Dll directly.
Prototype  slGetErrorNumber()
;========================================================================
Prototype  sluAttach(a, b, c)
Prototype  sluBuildBindDat(a, b, c, d, e)
Prototype  sluBuildInsertOrUpdate(a, b, c, d, e, f, g)
;Prototype  sluConnect(a, b, c, d, e)
Prototype  sluConvertDat(a, b, c, d, e)
Prototype  sluCopyDatabase(a, b, c)
;Prototype  sluExe(a, b)
Prototype  sluExeBind(a, b, c, d)
;Prototype  sluF(a, b, c, d)
Prototype  sluFN(a, b, c, d)
Prototype  sluFNX(a, b, c, d, e)
Prototype  sluFX(a, b, c, d, e)
Prototype  sluGetColumnName(a, b, c, d)
Prototype  sluGetColumnNumber(a, b)
Prototype  sluGetDatabaseAndFileNames(a, b)
;Prototype  sluGetError(a, b)
Prototype  sluGetFieldDataTypes(a, b, c)
Prototype  sluGetFile(a, b, c, d)
Prototype  sluGetHandle(a, b)
;Prototype  sluGetRow(a, b)
Prototype  sluGetStatus(a, b, c)
;Prototype  sluGetTableColumnNames(a, b, c)
Prototype  sluGetTableNames(a, b, c)
Prototype  sluIsColumnNameValid(a, b)
Prototype  sluIsDatabaseNameValid(a)
Prototype  sluIsTableNameValid(a)
;Prototype  sluOpen(a, b)
Prototype  sluPopDatabase(a)
Prototype  sluPopSet(a, b, c)
Prototype  sluPushDatabase(a)
Prototype  sluPushSet(a, b, c)
Prototype  sluPutFile(a, b, c, d)
Prototype  sluRunProc(a, b, c, d, e, f, g, h, i, j)
;Prototype  sluSel(a, b, c)
Prototype  sluSelBind(a, b, c, d, e)
;Prototype  sluSelStr(a, b, c, d)
;Prototype  sluSetProcessMods(a)
Prototype  sluSetRelNamedLocks(a, b, c, d, e)
Prototype  sulGetChangeCount(a)
Prototype  IRISDATE(a)
Prototype  slCloseSet(a)
Prototype  slDisconnect()
Prototype  slGetColumnName(a, b)
Prototype  slGetColumnNumber(a, b)
;Prototype  slGetErrorNumber()
Prototype  slGetInsertID()
Prototype  slGetUnusedSetNumber()
Prototype  slIsColumnNumberValid(a, b)
Prototype  slIsFieldNull(a, b)
Prototype  slIsOpen()
Prototype  slIsSetNumberValid(a)
Global sluAttach.sluAttach
Global sluBuildBindDat.sluBuildBindDat
Global sluBuildInsertOrUpdate.sluBuildInsertOrUpdate
Global sluConnect.sluConnect
Global sluConvertDat.sluConvertDat
Global sluCopyDatabase.sluCopyDatabase
Global sluExe.sluExe
Global sluExeBind.sluExeBind
Global sluF.sluF
Global sluFN.sluFN
Global sluFNX.sluFNX
Global sluFX.sluFX
Global sluGetColumnName.sluGetColumnName
Global sluGetColumnNumber.sluGetColumnNumber
Global sluGetDatabaseAndFileNames.sluGetDatabaseAndFileNames
Global sluGetError.sluGetError
Global sluGetFieldDataTypes.sluGetFieldDataTypes
Global sluGetFile.sluGetFile
Global sluGetHandle.sluGetHandle
Global sluGetRow.sluGetRow
Global sluGetStatus.sluGetStatus
Global sluGetTableColumnNames.sluGetTableColumnNames
Global sluGetTableNames.sluGetTableNames
Global sluIsColumnNameValid.sluIsColumnNameValid
Global sluIsDatabaseNameValid.sluIsDatabaseNameValid
Global sluIsTableNameValid.sluIsTableNameValid
Global sluOpen.sluOpen
Global sluPopDatabase.sluPopDatabase
Global sluPopSet.sluPopSet
Global sluPushDatabase.sluPushDatabase
Global sluPushSet.sluPushSet
Global sluPutFile.sluPutFile
Global sluRunProc.sluRunProc
Global sluSel.sluSel
Global sluSelBind.sluSelBind
Global sluSelStr.sluSelStr
Global sluSetProcessMods.sluSetProcessMods
Global sluSetRelNamedLocks.sluSetRelNamedLocks
Global sulGetChangeCount.sulGetChangeCount
Global IRISDATE.IRISDATE
Global slClose.slClose
Global slCloseSet.slCloseSet
Global slDisconnect.slDisconnect
Global slGetColumnCount.slGetColumnCount
Global slGetColumnName.slGetColumnName
Global slGetColumnNumber.slGetColumnNumber
Global slGetErrorNumber.slGetErrorNumber
Global slGetInsertID.slGetInsertID
Global slGetUnusedSetNumber.slGetUnusedSetNumber
Global slIsColumnNumberValid.slIsColumnNumberValid
Global slIsFieldNull.slIsFieldNull
Global slIsOpen.slIsOpen
Global slIsSetNumberValid.slIsSetNumberValid
Procedure.i SQLiteningU_LoadDLL()
  Protected hDLL.i
  hDLL = OpenLibrary(#PB_Any, "SQLiteningU.dll")
  If hDLL <> 0
    sluAttach = GetFunction(hDLL, "sluAttach")
    sluBuildBindDat = GetFunction(hDLL, "sluBuildBindDat")
    sluBuildInsertOrUpdate = GetFunction(hDLL, "sluBuildInsertOrUpdate")
    sluConnect = GetFunction(hDLL, "sluConnect")
    sluConvertDat = GetFunction(hDLL, "sluConvertDat")
    sluCopyDatabase = GetFunction(hDLL, "sluCopyDatabase")
    sluExe = GetFunction(hDLL, "sluExe")
    sluExeBind = GetFunction(hDLL, "sluExeBind")
    sluF = GetFunction(hDLL, "sluF")
    sluFN = GetFunction(hDLL, "sluFN")
    sluFNX = GetFunction(hDLL, "sluFNX")
    sluFX = GetFunction(hDLL, "sluFX")
    sluGetColumnName = GetFunction(hDLL, "sluGetColumnName")
    sluGetColumnNumber = GetFunction(hDLL, "sluGetColumnNumber")
    sluGetDatabaseAndFileNames = GetFunction(hDLL, "sluGetDatabaseAndFileNames")
    sluGetError = GetFunction(hDLL, "sluGetError")
    sluGetFieldDataTypes = GetFunction(hDLL, "sluGetFieldDataTypes")
    sluGetFile = GetFunction(hDLL, "sluGetFile")
    sluGetHandle = GetFunction(hDLL, "sluGetHandle")
    sluGetRow = GetFunction(hDLL, "sluGetRow")
    sluGetStatus = GetFunction(hDLL, "sluGetStatus")
    sluGetTableColumnNames = GetFunction(hDLL, "sluGetTableColumnNames")
    sluGetTableNames = GetFunction(hDLL, "sluGetTableNames")
    sluIsColumnNameValid = GetFunction(hDLL, "sluIsColumnNameValid")
    sluIsDatabaseNameValid = GetFunction(hDLL, "sluIsDatabaseNameValid")
    sluIsTableNameValid = GetFunction(hDLL, "sluIsTableNameValid")
    sluOpen = GetFunction(hDLL, "sluOpen")
    sluPopDatabase = GetFunction(hDLL, "sluPopDatabase")
    sluPopSet = GetFunction(hDLL, "sluPopSet")
    sluPushDatabase = GetFunction(hDLL, "sluPushDatabase")
    sluPushSet = GetFunction(hDLL, "sluPushSet")
    sluPutFile = GetFunction(hDLL, "sluPutFile")
    sluRunProc = GetFunction(hDLL, "sluRunProc")
    sluSel = GetFunction(hDLL, "sluSel")
    sluSelBind = GetFunction(hDLL, "sluSelBind")
    sluSelStr = GetFunction(hDLL, "sluSelStr")
    sluSetProcessMods = GetFunction(hDLL, "sluSetProcessMods")
    sluSetRelNamedLocks = GetFunction(hDLL, "sluSetRelNamedLocks")
    sulGetChangeCount = GetFunction(hDLL, "sulGetChangeCount")
    ProcedureReturn hDLL
  EndIf
  ProcedureReturn #False
EndProcedure
Procedure.i SQLitening_LoadDLL()
  Protected hDLL.i
  hDLL = OpenLibrary(#PB_Any, "SQLitening.dll")
  If hDLL <> 0
    IRISDATE = GetFunction(hDLL, "IRISDATE")
    slAttach = GetFunction(hDLL, "slAttach")
    slBuildBindDat = GetFunction(hDLL, "slBuildBindDat")
    slBuildInsertOrUpdate = GetFunction(hDLL, "slBuildInsertOrUpdate")
    slClose = GetFunction(hDLL, "slClose")
    slCloseSet = GetFunction(hDLL, "slCloseSet")
    slConnect = GetFunction(hDLL, "slConnect")
    slConvertDat = GetFunction(hDLL, "slConvertDat")
    slCopyDatabase = GetFunction(hDLL, "slCopyDatabase")
    slDisconnect = GetFunction(hDLL, "slDisconnect")
    slExe = GetFunction(hDLL, "slExe")
    slExeBind = GetFunction(hDLL, "slExeBind")
    slF = GetFunction(hDLL, "slF")
    slFN = GetFunction(hDLL, "slFN")
    slFNX = GetFunction(hDLL, "slFNX")
    slFX = GetFunction(hDLL, "slFX")
    slGetChangeCount = GetFunction(hDLL, "slGetChangeCount")
    slGetColumnCount = GetFunction(hDLL, "slGetColumnCount")
    slGetColumnName = GetFunction(hDLL, "slGetColumnName")
    slGetColumnNumber = GetFunction(hDLL, "slGetColumnNumber")
    slGetDatabaseAndFileNames = GetFunction(hDLL, "slGetDatabaseAndFileNames")
    slGetError = GetFunction(hDLL, "slGetError")
    slGetErrorNumber = GetFunction(hDLL, "slGetErrorNumber")
    slGetFieldDataTypes = GetFunction(hDLL, "slGetFieldDataTypes")
    slGetFile = GetFunction(hDLL, "slGetFile")
    slGetHandle = GetFunction(hDLL, "slGetHandle")
    slGetInsertID = GetFunction(hDLL, "slGetInsertID")
    slGetRow = GetFunction(hDLL, "slGetRow")
    slGetStatus = GetFunction(hDLL, "slGetStatus")
    slGetTableColumnNames = GetFunction(hDLL, "slGetTableColumnNames")
    slGetTableNames = GetFunction(hDLL, "slGetTableNames")
    slGetUnusedSetNumber = GetFunction(hDLL, "slGetUnusedSetNumber")
    slIsColumnNameValid = GetFunction(hDLL, "slIsColumnNameValid")
    slIsColumnNumberValid = GetFunction(hDLL, "slIsColumnNumberValid")
    slIsDatabaseNameValid = GetFunction(hDLL, "slIsDatabaseNameValid")
    slIsFieldNull = GetFunction(hDLL, "slIsFieldNull")
    slIsOpen = GetFunction(hDLL, "slIsOpen")
    slIsSetNumberValid = GetFunction(hDLL, "slIsSetNumberValid")
    slIsTableNameValid = GetFunction(hDLL, "slIsTableNameValid")
    slOpen = GetFunction(hDLL, "slOpen")
    slPopDatabase = GetFunction(hDLL, "slPopDatabase")
    slPopSet = GetFunction(hDLL, "slPopSet")
    slPushDatabase = GetFunction(hDLL, "slPushDatabase")
    slPushSet = GetFunction(hDLL, "slPushSet")
    slPutFile = GetFunction(hDLL, "slPutFile")
    slRunProc = GetFunction(hDLL, "slRunProc")
    slSel = GetFunction(hDLL, "slSel")
    slSelAry = GetFunction(hDLL, "slSelAry")
    slSelBind = GetFunction(hDLL, "slSelBind")
    slSelStr = GetFunction(hDLL, "slSelStr")
    slSetProcessMods = GetFunction(hDLL, "slSetProcessMods")
    slSetRelNamedLocks = GetFunction(hDLL, "slSetRelNamedLocks")
    ProcedureReturn hDLL
  EndIf
  ProcedureReturn #False
EndProcedure
Procedure.s slGetError()
        Protected err$
        Protected len.l = 1024
        Protected buffer.i = AllocateMemory(len)
       
        sluGetError(buffer,@len)
        If len <> -1
            err$ = PeekS(buffer,-1,#PB_Ascii)
        EndIf
       
        FreeMemory(buffer)
        ProcedureReturn err$
      EndProcedure
      ;-------------------------------------------