SQLite3 on Windows

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

SQLite3 on Windows

Phoenix
I've downloaded the dll-win32 version of SQLite3 and have a couple of
questions.

1) Does sqlite3.exe require the .dll file or is it stand-alone?

2) Does the .dll need to be in a specific folder or is it okay if the
folder is listed in my PATH?
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: SQLite3 on Windows

Dominique Devienne
On Tue, Oct 10, 2017 at 11:49 AM, Phoenix <[hidden email]>
wrote:

> I've downloaded the dll-win32 version of SQLite3 and have a couple of
> questions.
>
> 1) Does sqlite3.exe require the .dll file or is it stand-alone?
>
> 2) Does the .dll need to be in a specific folder or is it okay if the
> folder is listed in my PATH?
>

Not to sound too snarky, but both questions can easily be answered through
experimentation.
You can also use http://www.dependencywalker.com/ to inspect DLL and EXE
dependencies. --DD
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: SQLite3 on Windows

Warren Young
In reply to this post by Phoenix
On Oct 10, 2017, at 3:49 AM, Phoenix <[hidden email]> wrote:
>
> 2) Does the .dll need to be in a specific folder or is it okay if the
> folder is listed in my PATH?

https://msdn.microsoft.com/en-us/library/windows/desktop/ms682586(v=vs.85).aspx

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: SQLite3 on Windows

Keith Medcalf

Hmmm.  

Must be rather old since it mentions 16-bit Windows but not 64-bit Windows.  So for all the parts that reference the "System" directories you need to apply a grain of salt....

64-bit Windows looks for 64-bit DLLs in Windows\System32
64-bit Windows looks for 32-bit DLLs in Windows\SysWOW64 (and not in Windows\System32)
32-bit Windows looks for 32-bit DLLs in Windows\System32
32-bit Windows looks for 16-bit DLLs in Windows\System

The "Common Files" search location is automagically, on 64-bit Windows,
Program Files (x86)\Common Files when looking for at 32-bit DLL and
Program Files\Common Files when looking for 64-bit DLL

Similarly the names for 32-bit versions of Windows searching for 32-bit DLLs is
Program Files\Common Files

Also, searches that search the "Program Files" tree will automatically use "Program Files (x86)" tree if looking for 32-bit DLLs on 64-bit Windows
Other search locations in the AppData tree also magically redirect to the (x86) directories if looking for 32-bit DLLs on 64-bit Windows

Paths are not modified so you better hope that if you put the DLL in a directory in the (various) paths that it will attempt to load ONLY THE FIRST such DLL found and will crash (or the loader will fail) if the DLL first found is the wrong "bitedness".  There are sekret registry hacks that you can do to register the "same" module in different locations for 16/32/64 loading automagically (more or less) but those hacks are not officially supported.

So, if you are using multiple versions of the same module named DLL, you have to be careful where you put it, unless you know that you will only ever require one model, or the application itself loads the DLL from the Application Directory.  Otherwise, if you need multiple models simultaneously you need to be careful where you put them of use the default System directories.

---
The fact that there's a Highway to Hell but only a Stairway to Heaven says a lot about anticipated traffic volume.


>-----Original Message-----
>From: sqlite-users [mailto:sqlite-users-
>[hidden email]] On Behalf Of Warren Young
>Sent: Tuesday, 10 October, 2017 08:57
>To: SQLite mailing list
>Subject: Re: [sqlite] SQLite3 on Windows
>
>On Oct 10, 2017, at 3:49 AM, Phoenix <[hidden email]>
>wrote:
>>
>> 2) Does the .dll need to be in a specific folder or is it okay if
>the
>> folder is listed in my PATH?
>
>https://msdn.microsoft.com/en-
>us/library/windows/desktop/ms682586(v=vs.85).aspx
>
>_______________________________________________
>sqlite-users mailing list
>[hidden email]
>http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users



_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: SQLite3 on Windows

Barry Smith
Perhaps I misunderestimate your question, but I think a certain amount of
explanation of how SQLite works may be in order. What are you trying to do?

The SQLite shell tool does not depend on the DLL (the SQLite library is
instead included in the executable file). You can put sqlite3.exe wherever
you like and do not need to copy anything else around with it. Probably in
a PATH folder is best, so you can access it whenever necessary; but I have
also included it in project folders that I have worked on so I can check it
straight into source control to make it easier for other developers to use
(with a certain amount of cringing about what I was doing).

SQLite is not like other database management systems (MSSQL, MySql,
Postgre, etc.) in that it does not have a dedicated server that runs to
control DB access. Instead, every application that wants to use SQLite
directly accesses the relevant files, using the SQLite library. The library
can be though of as a component of the particular app that wishes to access
SQLite databases.

As a result, as a user you should not need to put the dll anywhere. Any
program that relies on SQLite should include it with its distribution,
either as a DLL which will be installed into that programs install
directly, or compiled directly into the executable of the program.

You should only need the SQLite dll if you intend to build applications
(using an unmanaged language, such as C or C++) that use SQLite*. In that
case, it will likely reside with other third party libraries your project
references, and you should ensure that any installer you distribute
includes that file.

*Sometimes it's better to use the dll file to build applications, sometimes
it's better to just download a copy of the amalgamation c source files and
include that in your project.

On 10 October 2017 at 08:38, Keith Medcalf <[hidden email]> wrote:

>
> Hmmm.
>
> Must be rather old since it mentions 16-bit Windows but not 64-bit
> Windows.  So for all the parts that reference the "System" directories you
> need to apply a grain of salt....
>
> 64-bit Windows looks for 64-bit DLLs in Windows\System32
> 64-bit Windows looks for 32-bit DLLs in Windows\SysWOW64 (and not in
> Windows\System32)
> 32-bit Windows looks for 32-bit DLLs in Windows\System32
> 32-bit Windows looks for 16-bit DLLs in Windows\System
>
> The "Common Files" search location is automagically, on 64-bit Windows,
> Program Files (x86)\Common Files when looking for at 32-bit DLL and
> Program Files\Common Files when looking for 64-bit DLL
>
> Similarly the names for 32-bit versions of Windows searching for 32-bit
> DLLs is
> Program Files\Common Files
>
> Also, searches that search the "Program Files" tree will automatically use
> "Program Files (x86)" tree if looking for 32-bit DLLs on 64-bit Windows
> Other search locations in the AppData tree also magically redirect to the
> (x86) directories if looking for 32-bit DLLs on 64-bit Windows
>
> Paths are not modified so you better hope that if you put the DLL in a
> directory in the (various) paths that it will attempt to load ONLY THE
> FIRST such DLL found and will crash (or the loader will fail) if the DLL
> first found is the wrong "bitedness".  There are sekret registry hacks that
> you can do to register the "same" module in different locations for
> 16/32/64 loading automagically (more or less) but those hacks are not
> officially supported.
>
> So, if you are using multiple versions of the same module named DLL, you
> have to be careful where you put it, unless you know that you will only
> ever require one model, or the application itself loads the DLL from the
> Application Directory.  Otherwise, if you need multiple models
> simultaneously you need to be careful where you put them of use the default
> System directories.
>
> ---
> The fact that there's a Highway to Hell but only a Stairway to Heaven says
> a lot about anticipated traffic volume.
>
>
> >-----Original Message-----
> >From: sqlite-users [mailto:sqlite-users-
> >[hidden email]] On Behalf Of Warren Young
> >Sent: Tuesday, 10 October, 2017 08:57
> >To: SQLite mailing list
> >Subject: Re: [sqlite] SQLite3 on Windows
> >
> >On Oct 10, 2017, at 3:49 AM, Phoenix <[hidden email]>
> >wrote:
> >>
> >> 2) Does the .dll need to be in a specific folder or is it okay if
> >the
> >> folder is listed in my PATH?
> >
> >https://msdn.microsoft.com/en-
> >us/library/windows/desktop/ms682586(v=vs.85).aspx
> >
> >_______________________________________________
> >sqlite-users mailing list
> >[hidden email]
> >http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
>
>
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: SQLite3 on Windows

Stephen Chrzanowski
In reply to this post by Phoenix
1> Standalone
2.a> If you're referring to the DLL from an application you're building, it
must be either the Path, or, in the "Directory" your shortcut points to,
which is either something custom, or, the EXEs current directory.  Its
already been mentioned where that DLL should be placed.
2.b> If you're referring to the DLL being needed for the sqlite3.exe app,
its not needed at all.

Based purely on my experience with Delphi (From Borland Version 5 to
Emarcadero 10.5 Berlin);

For point 2.a, there are three ways that I can think of to run the EXE.  In
any case, a valid place is to put the DLL in a directory specified in your
%PATH% environment variable, unless you're concerned about DLL HELL and
other applications with a custom Sqlite3.dll library decide to do some
overwriting.....

The first method of running an EXE is via a shortcut.  The order of
operations that the EXE (should) look for the DLL is where the "Start In"
path dictates, and if it doesn't exist there, then it'll check %PATH%

The second method is directly running the EXE through the file browser.
The order of operations for that mode of running the EXE is the directory
you're running the EXE from is scanned, then your %PATH%

The third method is via a command line window, as an example, where you're
sitting in c:\Dir1 but you run the EXE as [c:\Dir2\Some.exe].  That order
of operation would be to look for the DLL in c:\Dir1 then %PATH%.

Y.M.M.V. depending on the build and compile options to where the library
files are loaded from.  I'm not aware of any documentation that specifies
where applications are to, or should, look for DLL files, but, I'm sure
I'll be smacked with that when someone in the know wants to correct me. :]

For anything I distribute, I include the DLL in the installation package
and have it put in the install directory, but, I don't rely on the DLL in
my applications directory, but, rather somewhere in the %PATH%. The reason
for putting the DLL in the EXE directory is two-fold:
- I'm not 100% sure, but either my build environment makes the EXE check
the local directory for the SQLite3.dll file first, then checks path.
- What I'm compiling is guaranteed to work vs what else might be on the
system.

On Tuesday, October 10, 2017, Phoenix <[hidden email]> wrote:

> I've downloaded the dll-win32 version of SQLite3 and have a couple of
> questions.
>
> 1) Does sqlite3.exe require the .dll file or is it stand-alone?
>
> 2) Does the .dll need to be in a specific folder or is it okay if the
> folder is listed in my PATH?
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: SQLite3 on Windows

Stephen Chrzanowski
err.. that should be Embarcadero 10.1 Berlin... ugh.. PROOFREAD!!!

On Tue, Oct 10, 2017 at 4:20 PM, Stephen Chrzanowski <[hidden email]>
wrote:

>
> Based purely on my experience with Delphi (From Borland Version 5 to
> Emarcadero 10.5 Berlin);
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

sqlite3_expert Status

Philip Bennefall
Dear SqLite developers,

I was curious to know the status of the sqlite3_expert extension? I
followed its development with great interest earlier in the year and was
wondering if there are any plans to merge it to trunk? What kind of work
remains (if any) before it can be considered complete?

Thanks,

Philip Bennefall
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: sqlite3_expert Status

Dominique Devienne
On Wed, Oct 11, 2017 at 10:58 AM, Philip Bennefall <[hidden email]>
wrote:

> I was curious to know the status of the sqlite3_expert extension? I
> followed its development with great interest earlier in the year and was
> wondering if there are any plans to merge it to trunk? What kind of work
> remains (if any) before it can be considered complete?
>

For those like me who missed / forgot / didn't know about SQLite Expert,
read about it here: https://www.sqlite.org/cgi/src/tree?name=ext/expert --DD

PS: part of "schemalint" apparently:
https://www.sqlite.org/cgi/src/timeline?t=schemalint&n=200
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: sqlite3_expert Status

Simon Slavin-3


On 11 Oct 2017, at 10:53am, Dominique Devienne <[hidden email]> wrote:

> For those like me who missed / forgot / didn't know about SQLite Expert,
> read about it here: https://www.sqlite.org/cgi/src/tree?name=ext/expert --DD

That’s clever.  I like that.

Simon.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: SQLite3 on Windows

Phoenix
In reply to this post by Phoenix
Sorry I have not responded to the raised questions on this post but I
have not received any Digests since the 8th (Volume 118 Issue 8).

Dominique wrote:

    Not to sound too snarky, but both questions can easily be answered through experimentation.
    You can also use http://www.dependencywalker.com/ to inspect DLL and EXE dependencies. --DD

It's a bit difficult to do that if you don't have access to a Windows
box. I have been using Linux since Jan 2009 and I haven't touched
Windows since then.

I have written a library of user defined functions for the GnuCOBOL
Project and somebody had some problems with setting up SQLite3 on their
Windows box. I was just trying to get some info to help him.

He had downloaded sqlite-dll-win32-x86-3200100.zip and after unzipping
it was trying to link it to his GnuCOBOL program and having problems.
One of the project developers was able to put him right.

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: SQLite3 on Windows

Dominique Devienne
On Sat, Oct 14, 2017 at 10:47 PM, Phoenix <[hidden email]>
wrote:

> Dominique wrote:
>     Not to sound too snarky, but both questions can easily be answered
> through experimentation.
>     You can also use http://www.dependencywalker.com/ to inspect DLL and
> EXE dependencies. --DD
>
> It's a bit difficult to do that if you don't have access to a Windows
> box. I have been using Linux since Jan 2009 and I haven't touched
> Windows since then.
>

OK. You didn't mention that before. I'm sure Linux has a way to look inside
Windows PE binaries, e.g. [1] below perhaps, but whether one can get the
dependencies easily, I don't know.

Had you explained your lack of Windows access, i.e. context, you'd probably
have gotten your answer quicker, FWIW.

He had downloaded sqlite-dll-win32-x86-3200100.zip and after unzipping
> it was trying to link it to his GnuCOBOL program and having problems.
> One of the project developers was able to put him right.


Glad it worked out in the end, via a different channel. --DD

[1] https://ubuntuforums.org/showthread.php?t=1442258
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users