Forum > Databases
Replace substring in a field and update DB
Thaddy:
Made one more small edit (formatting)
TRon:
--- Quote from: PierceNg on January 13, 2023, 10:06:29 am ---Could be your program cannot find the SQLite DLL. You're compiling for i386-Win32, so your SQLite DLL should be 32bit. Copy the DLL to the same directory as test.exe.
--- End quote ---
When the dll/library is not present then fpc emits a meaningful exception:
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} --- sqlite3conn.SQLiteLibraryName := 'unavailable_library'; That will throw an exception when the connected property is set to true:
--- Code: ---An unhandled exception occurred at $00000000004F5232:
EInOutError: Can not load SQLite client library "unavailable_library". Check your installation.
$00000000004F5232
$0000000000460B8E
--- End code ---
No idea what happens when you try to load a library with the wrong bitness (on Windows) though (shouldn't the load fail, and consequently throw the same exception ?)
Thaddy:
--- Quote from: PierceNg on January 13, 2023, 10:06:29 am ---Could be your program cannot find the SQLite DLL. You're compiling for i386-Win32, so your SQLite DLL should be 32bit. Copy the DLL to the same directory as test.exe.
--- End quote ---
Although that works, it is not the proper way to do things, because you need a copy of the dll's for every new application. This leads to disk rot.
The recommended way is like this, read carefully because it can be confusing:
1. On a 32bit WIN32 OS put a 32 bit Sqlite3.dll in \windows\system32 and you can pick and mix.
2. On a 64bit WIN64 OS, but your code compiled for 32 bit, the 32 bit dll should go in \windows\sysWOW64. WOW64 represents Windows32 on Windows 64.
3. On a 64bit WIN64 OS, with your code compiled for 64 bit, a 64bit dll should go in \windows\system32 and that is not a typo.
Point 3 makes things a bit confusing, but yes, on WIN64 64 bit dll's go in the \windows\system32 directory and 32 bit dll s go in sysWOW64
If you do that properly you won't have any issues with either 32 bit or 64 bit applications. If both are installed properly you can pick and mix between 32 and 64.
(Do this for all commonly used dll's, e.g., not only sqlite, but also opensll etc. )
Navigation
[0] Message Index
[*] Previous page