dblib.dll nightmare lazarus / 16-Databases ---------------------------------------------------------------------- engine32 · 2023-05-20 19:47 I have an application that connects to a local MSSQL server on another computer. I wrote it on Win7 and it works.   Then I transferred it to another computer with Win10. It also works well. I compiled it on Win10 and works.   Then I transferred it to a computer with Win11 Home and I could not get it to work. I keep getting a message that it can not load dblib.dll.   I also placed files dblib.dll and libiconv.dll in the folder with the exe file, in windows system32 and SysWOW64 and Lazarus.   Running out of options, I upgraded from Windows 11 Home to Windows 11 Pro to no avail.   Then I installed Lazarus on this computer and compiled without errors. However, when I launch the application, the message appears again. Then I installed SQL Management Studio, thinking that it will bring some needed files. Still no luck. I am out of options.   It is something with Win 11 ?   Thank you. ---------------------------------------------------------------------- dsiders · 2023-05-20 20:27 Quote from: engine32 on May 20, 2023, 09:47:21 pm  I have an application that connects to a local MSSQL server on another computer. I wrote it on Win7 and it works.   Then I transferred it to another computer with Win10. It also works well. I compiled it on Win10 and works.   Then I transferred it to a computer with Win11 Home and I could not get it to work. I keep getting a message that it can not load dblib.dll.   I also placed files dblib.dll and libiconv.dll in the folder with the exe file, in windows system32 and SysWOW64 and Lazarus.   Running out of options, I upgraded from Windows 11 Home to Windows 11 Pro to no avail.   Then I installed Lazarus on this computer and compiled without errors. However, when I launch the application, the message appears again. Then I installed SQL Management Studio, thinking that it will bring some needed files. Still no luck. I am out of options.   It is something with Win 11 ?   Thank you. Did you use the Forum Search to look at previous threads on the topic? dblib.dll has dependencies (other than libiconv.dll) that are probably not met, like the correct version of the VC++ Runtime library. ---------------------------------------------------------------------- TRon · 2023-05-20 20:50 Besides what dsiders already wrote, see also wiki Oh, and just to thrown it in for completeness: bitness ---------------------------------------------------------------------- wp · 2023-05-20 21:03 Quote from: engine32 on May 20, 2023, 09:47:21 pmI also placed files dblib.dll and libiconv.dll [...] in windows system32 and SysWOW64 [...]. Placing the same files into System32 and SysWOW64 normally is a bad idea. System32 is for the 64-bit dlls only, SysWOW64 for 32-bit only (no typo!) ---------------------------------------------------------------------- engine32 · 2023-05-20 23:47 Unbelievable, it works.   I went to https://wiki.freepascal.org/mssqlconn#EINOutError.2FCan_not_load_DB- Lib_client_library_.22dblib.dll.22._Check_your_installation as TRon suggested.   From there I went to http://downloads.freepascal.org/fpc/contrib/windows/ and downloaded dblib_x64.zip .   I unzipped and selected Win64/dblib.dll. The exact file size is 357,376 bytes (initially I tried dblib_current but it did not work; that dll is slightly larger as someone mentioned in another post).   It did not work. Then I went to the libraries and found that I do not have VC++ 2010 as the readme.txt file in the archive says. However, there was one from 2017 x64 but still did not do the trick. I installed VC++ x64 2010 one and bingo, it works.   The screenshot in the attached picture is after I installed VC++ 2010.   Thank you to all who responded.   Edit: the computers where it worked before I installed many other software like MPLAB, AVR Studio, some logic analyzer, Wireshark and others. I believe that it just happened that the right VC++ libraries were installed at that time without realizing it. Now on a fresh install it did not work. Well, I still learn.