Getting sqlite3.dll not found error with Delphi -
i getting sqlite3.dll
not found error @ delphi app. have sqlite3.dll file on pc located @ e://sqlite-dll-win32-x86-3071700
my source follows
procedure tform2.button1click(sender: tobject); var results: tdataset; begin sqlconnection1.params.add('database=e://empn.s3db'); sqlconnection1.libraryname := 'e://sqlite-dll-win32-x86-3071700/sqlite3.dll'; try sqlconnection1.connected := true; sqlmonitor1.active := true; sqlconnection1.execute('selct * usergroup', nil, results) end; end;
as mentioned in above code pointed out path library by
sqlconnection1.libraryname := 'e://sqlite-dll-win32-x86-3071700/sqlite3.dll';
but still error sqlite3.dll not found. how troubleshoot error?
a small note
beginning delphi xe3, libraryname
is obsolete.
in older delphi versions, libraryname indicated "dbexpress library associated driver" (e.g. dbxfb.dll firebird), while vendorlib indicated "library supplied database vendor support client-side use of database" (e.g. fbclient.dll/fbembed.dll firebird, equivalent sqlite's sqlite3.dll).
embarcadero's sqlite dbexpress driver
in on windows, driver uses delayed loading of sqlite3.dll. like:
function sqlite3_open_v2; external 'sqlite3.dll' delayed;
so dll loaded loadlibrary , standard search strategy find modules applies (first process directory, usual path list).
however stategy can altered using setdlldirectory.
so have put sqlite3.dll accessible thru path or try following hack:
(beware interfere other code have used setdlldirectory; see david heffernan's comment)
setdlldirectory('e:\sqlite-dll-win32-x86-3071700'); try sqlconnection1.open; setdlldirectory(''); // restore default search order end;
warning: make sure not mixing 32 , 64 bits modules (i.e. 32 bit exe , 64 bit dll or vice versa).
Comments
Post a Comment