wrapper - dll translation
Re: wrapper - dll translation
In the download package i can't find a "sample.db3" for this demo, so it can't work.
// edit
the sample.db3 is in the bin directory, you have to copy it to your source.
// edit
the sample.db3 is in the bin directory, you have to copy it to your source.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Re: wrapper - dll translation
That is what i have done.he sample.db3 is in the bin directory, you have to copy it to your source.
I can open the DLL and do the Query, but nothing is coming back.
Richard
Re: wrapper - dll translation
Simple problem was: SluOpen returns 0 for OK, and error code when failed. So my If SluOpen() was wrong, that's all.t57042 wrote:That is what i have done.he sample.db3 is in the bin directory, you have to copy it to your source.
I can open the DLL and do the Query, but nothing is coming back.
Richard
Code: Select all
Prototype sluF(ColumNumber.l, *FieldValue, *SizeOfField, SetNumber.l = 0)
Prototype sluGetRow(SetNumber.l = 0, ModChars.p-ascii = 0)
Prototype sluOpen(FileName.p-ascii = 0 , ModChars.p-ascii = 0)
Prototype sluSel(Statement.p-ascii, SetNumber.l = 0, ModChars.p-ascii = 0)
Global sluF.sluF
Global sluGetRow.sluGetRow
Global sluOpen.sluOpen
Global sluSel.sluSel
Procedure.i SQLiteningU_LoadDLL()
Protected hDLL.i
hDLL = OpenLibrary(#PB_Any, "SQLiteningU.dll")
If hDLL <> 0
sluF = GetFunction(hDLL, "sluF")
sluGetRow = GetFunction(hDLL, "sluGetRow")
sluOpen = GetFunction(hDLL, "sluOpen")
sluSel = GetFunction(hDLL, "sluSel")
ProcedureReturn hDLL
EndIf
ProcedureReturn #False
EndProcedure
;XIncludeFile "SQLiteningU.inc"
dll = SQLiteningU_LoadDLL()
If dll
err = sluOpen (GetPathPart(ProgramFilename())+"sample.db3")
If Not err
err = sluSel("Select * from Parts where rowid < 11")
If Not err
While sluGetRow()
Rec$ = ""
For i = 1 To 4
buffer$ = Space(100)
len = Len(buffer$)
sluF(i, @buffer$, @len)
Rec$ + PeekS(@buffer$,len,#PB_Ascii) + " - "
Next
Debug rec$
Wend
Else
Debug "Error with sluSel(): "+Str(err)
EndIf
Else
Debug "can't open sample.db3 - Error code: "+Str(err)
EndIf
CloseLibrary(dll)
End
EndIf
Re: wrapper - dll translation
Many thanks Danilo - this works (and I am learning
).
Next function I'm trying to implement is:
I modified both files as follows:
Get error:
Richard

Next function I'm trying to implement is:
As the doc says it calls SQlitening.dll directly (previous functions call SQliteningU.dll);
;'========================<[ Get Column Count ]>========================
;Declare Function sluGetColumnCount lib "SQLitening.Dll" alias "slGetColumnCount" ( _
; byval SetNumber As Long) As Long
; Calls SQLitening.Dll directly.
I modified both files as follows:
Code: Select all
;sqliteningU.inc
Prototype sluF(ColumNumber.l, *FieldValue, *SizeOfField, SetNumber.l = 0)
Prototype sluGetRow(SetNumber.l = 0, ModChars.p-ascii = 0)
Prototype sluOpen(FileName.p-ascii = 0 , ModChars.p-ascii = 0)
Prototype sluSel(Statement.p-ascii, SetNumber.l = 0, ModChars.p-ascii = 0)
Prototype sluGetColumnCount(SetNumber.l)
Global sluF.sluF
Global sluGetRow.sluGetRow
Global sluOpen.sluOpen
Global sluSel.sluSel
Global sluGetColumnCount
Procedure.i SQLiteningU_LoadDLL()
Protected hDLL.i
hDLL = OpenLibrary(#PB_Any, "SQLiteningU.dll")
If hDLL <> 0
sluF = GetFunction(hDLL, "sluF")
sluGetRow = GetFunction(hDLL, "sluGetRow")
sluOpen = GetFunction(hDLL, "sluOpen")
sluSel = GetFunction(hDLL, "sluSel")
sluGetColumnCount=GetFunction(hDLL, "sluGetColumnCount")
ProcedureReturn hDLL
EndIf
ProcedureReturn #False
EndProcedure
Procedure.i SQLitening_LoadDLL()
Protected hDLL.i
hDLL = OpenLibrary(#PB_Any, "SQLitening.dll")
If hDLL <> 0
sluGetColumnCount=GetFunction(hDLL, "sluGetColumnCount")
ProcedureReturn hDLL
EndIf
ProcedureReturn #False
EndProcedure
Code: Select all
XIncludeFile "SQLiteningU.inc"
dll = SQLiteningU_LoadDLL()
dll2 = SQLitening_LoadDLL()
If dll
err = sluOpen ("sample.db3")
If Not err
err = sluSel("Select * from Parts where rowid < 11")
If Not err
NumFlds = sluGetColumnCount()
While sluGetRow()
Rec$ = ""
For i=1 To NumFlds
;For i = 1 To 4
buffer$ = Space(100)
len = Len(buffer$)
sluF(i, @buffer$, @len)
Rec$ + PeekS(@buffer$,len,#PB_Ascii) + " - "
Next
Debug rec$
Wend
Else
Debug "Error with sluSel(): "+Str(err)
EndIf
Else
Debug "can't open sample.db3 - Error code: "+Str(err)
EndIf
CloseLibrary(dll)
End
EndIf
What is wrong here?sluGetColumnCount() is not a function
Richard
Re: wrapper - dll translation
Why not using my DLLHelper?
There is no function "sluGetColumnCount" in "SQLiteningU.dll"
Only the function "slGetColumnCount" is in "SQLitening.dll"
You can't use functions, the a not in the DLL
There is no function "sluGetColumnCount" in "SQLiteningU.dll"
Only the function "slGetColumnCount" is in "SQLitening.dll"
You can't use functions, the a not in the DLL

PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Re: wrapper - dll translation
Well, i'd like to - but I don't know how to use the wrapper.
This is the wrapper created by PUREDLLHelper:
And this is the calling code which works with the wrapper adapted by Danilo.
Can you show me how to adapt this code to use your wrapper?
Richard
This is the wrapper created by PUREDLLHelper:
Code: Select all
;==========================================================================
; Generated with PureDLLHelper, Copyright ©2012 by Thomas <ts-soft> Schulz
;==========================================================================
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)
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
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
Code: Select all
XIncludeFile "SQLiteningU.inc"
dll = SQLiteningU_LoadDLL()
If dll
err = sluOpen ("sample.db3")
If Not err
err = sluSel("Select * from Parts where rowid < 11")
If Not err
While sluGetRow()
Rec$ = ""
For i = 1 To 4
buffer$ = Space(100)
len = Len(buffer$)
sluF(i, @buffer$, @len)
Rec$ + PeekS(@buffer$,len,#PB_Ascii) + " - "
Next
Debug rec$
Wend
Else
Debug "Error with sluSel(): "+Str(err)
EndIf
Else
Debug "can't open sample.db3 - Error code: "+Str(err)
EndIf
CloseLibrary(dll)
End
EndIf
Richard
Re: wrapper - dll translation
change the prototypes as documented, thats all. It is not required to import all functions, you can select it.
and then:
and then:
Code: Select all
Define DLL = SQLiteningU_LoadDLL()
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Re: wrapper - dll translation
Can you give an example for: sluSel, sluGetrow, sluOpen and sluF to get me started?
Rthanks
Richard
Rthanks
Richard
Re: wrapper - dll translation
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Re: wrapper - dll translation
Ok, I get it.
How do I handle the calls to the functions in SQlitening.dll?
Do I create another .inc file?
Richard
How do I handle the calls to the functions in SQlitening.dll?
Do I create another .inc file?
Richard
Re: wrapper - dll translation
Sorry, solved it myself.Ok, I get it.
How do I handle the calls to the functions in SQlitening.dll?
Do I create another .inc file?
Richard
Re: wrapper - dll translation
@t57042: You can also link the DLLs directly to your executable instead loading DLLs dynamically.
Run this code to create the import libs:(requires the DLLs in same directory)
Check that the 3 .lib files are created.
Now you can use 'Import' for the functions:
@ts-soft:
Could you add this to your tool? Let the user choose to create dynamic loading includes or Import includes.
Run this code to create the import libs:
Code: Select all
;
; [X] Create temporary executable in the source directory
;
dir$ = GetPathPart(ProgramFilename())
RunProgram(#PB_Compiler_Home+"Compilers\POLIB.exe","SQLitening.dll /MACHINE:x86 /OUT:SQLitening.lib",dir$)
RunProgram(#PB_Compiler_Home+"Compilers\POLIB.exe","SQLiteningS.dll /MACHINE:x86 /OUT:SQLiteningS.lib",dir$)
RunProgram(#PB_Compiler_Home+"Compilers\POLIB.exe","SQLiteningU.dll /MACHINE:x86 /OUT:SQLiteningU.lib",dir$)
Check that the 3 .lib files are created.
Now you can use 'Import' for the functions:
Code: Select all
Import "SQLiteningU.lib"
sluF(ColumNumber.l, *FieldValue, *SizeOfField, SetNumber.l = 0)
sluGetRow(SetNumber.l = 0, ModChars.p-ascii = 0)
sluOpen(FileName.p-ascii = 0 , ModChars.p-ascii = 0)
sluSel(Statement.p-ascii, SetNumber.l = 0, ModChars.p-ascii = 0)
EndImport
Import "SQLitening.lib"
slGetColumnCount(SetNumber.l = 0)
EndImport
err = sluOpen (GetPathPart(ProgramFilename())+"sample.db3")
If Not err
err = sluSel("Select * from Parts where rowid < 11")
If Not err
Debug "ColumnCount: "+slGetColumnCount()
While sluGetRow()
Rec$ = ""
For i = 1 To 4
buffer$ = Space(100)
len = Len(buffer$)
sluF(i, @buffer$, @len)
Rec$ + PeekS(@buffer$,len,#PB_Ascii) + " - "
Next
Debug rec$
Wend
Else
Debug "Error with sluSel(): "+Str(err)
EndIf
Else
Debug "can't open sample.db3 - Error code: "+Str(err)
EndIf
Could you add this to your tool? Let the user choose to create dynamic loading includes or Import includes.
Re: wrapper - dll translation
See here: http://www.purebasic.fr/english/viewtop ... 27&t=52712Danilo wrote: @ts-soft:
Could you add this to your tool? Let the user choose to create dynamic loading includes or Import includes.
Drop the DLL on the GUI and the creation of ImportLib is done

With autodetection of x86 or x64!
Greetings - Thomas
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Re: wrapper - dll translation
Nice, thank you!ts-soft wrote:See here: http://www.purebasic.fr/english/viewtop ... 27&t=52712Danilo wrote: @ts-soft:
Could you add this to your tool? Let the user choose to create dynamic loading includes or Import includes.
Drop the DLL on the GUI and the creation of ImportLib is done![]()
With autodetection of x86 or x64!

Re: wrapper - dll translation
UPGRADE ON WRAPPER for SQlitening.
With the help of PureDLLHelper(Copyright ©2012 by Thomas <ts-soft> Schulz - tks marvelous piece of work
) I created the frame for the wrapper.
2 DLL's are needed: the main is SQliteningU.dll - but some functions must be called directly from SQlitening.dll.
This is the main program:
This is the wrapper:
Somebody knows how to adapt the PROTOTYPE in this function?
Richard
With the help of PureDLLHelper(Copyright ©2012 by Thomas <ts-soft> Schulz - tks marvelous piece of work

2 DLL's are needed: the main is SQliteningU.dll - but some functions must be called directly from SQlitening.dll.
This is the main program:
Code: Select all
XIncludeFile "SQLiteningPB.inc"
dll = SQLiteningU_LoadDLL()
dll2 = SQLitening_LoadDLL()
If dll And dll2
err = sluOpen ("sample.db3")
If Not err
err = sluSel("Select * from Parts where rowid < 11 order by price")
If Not err
NumFlds = slGetColumnCount()
While sluGetRow()
Rec$ = ""
For i=1 To NumFlds
buffer$ = Space(100)
len = Len(buffer$)
sluF(i, @buffer$, @len)
Rec$ + PeekS(@buffer$,len,#PB_Ascii) + " - "
Next
Debug rec$
Wend
Else
Debug "Error with sluSel(): "+Str(err)
EndIf
st$="create table if not exists test (field1,field2)"
err=sluExe(st$)
If Not err
MessageRequester("","table created")
Else
Debug "Error with sluExe(): "+Str(err)
EndIf
Else
Debug "can't open sample.db3 - Error code: "+Str(err)
EndIf
slclose()
CloseLibrary(dll)
CloseLibrary(dll2)
End
EndIf
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.p-ascii, d)
;==========================================================================
;************************************************************************
;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()
;========================================================================
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
Code: Select all
;============================<[ 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.p-ascii, d)