SQLite User Forum

Last version for Windows XP
Login

Last version for Windows XP

(1) By JyB900 on 2025-01-20 17:35:47 [link] [source]

I'm beginner. What is last version Sqlite for Windows XP?

(2) By anonymous on 2025-01-20 18:35:28 in reply to 1 [link] [source]

You may be limited more by the C compiler that's available on your given Windows XP instance, that is if you want to build SQLite from source yourself.

If you're looking for a binary/pre-built version, then it's also limited by the last C++ Redistributable available. Per Microsoft,

"...The last version of the Visual C++ Redistributable that works on Windows XP shipped in Visual Studio 2019 version 16.7 (file versions starting with 14.27)."

You may consider some GNU environments for Windows (CIGWIN or MINGW), which usually have build tools included. Again, these also ended Windows XP (and 32-bit) support at some point.

For the most part SQLite's source code is quite conservative in use of new C features. I remember building v3.31 (20200122) with VisualC++ 2005 on Windows XP 32-bit, back in 2020.

(3) By Stephan Beal (stephan) on 2025-01-20 18:55:09 in reply to 2 [link] [source]

For the most part SQLite's source code is quite conservative in use of new C features. I remember building v3.31 (20200122) with VisualC++ 2005 on Windows XP 32-bit, back in 2020.

Just the past week someone posted a patch to get SQLite 3.46 cross-compiling to DOS, so the odds are very good that it can (perhaps with a few similarly small patches) also be built for XP.

That said: XP is long-since off of this team's proverbial radar and it's no longer actively supported. We'd be glad to hear reports of getting it working, though.

(4.1) By Aask (AAsk1902) on 2025-01-20 19:25:00 edited from 4.0 in reply to 1 [link] [source]

I'm beginner.

Examine the pre-built versions that are available ... here.

If you are a beginner, you will almost certainly need the SQLite CLI (Command line interface). Only the 64-bit version of the CLI is published. However, the SQLite library is published in both 32- and 64- bit.

To use the 32-bit library, browse A very quick introduction to programming with SQLite. The full list of SQLite functions is found here.

To use the CLI, if your XP is 32-bit, you have to compile that version yourself; see here to learn how.

The CLI (SQLite3.EXE)) and library (SQLite3.DLL) are free-standing; that is, there is no dependency between them.

Determine if your Windows XP is 32- or 64-bit. (search with Google on how to do so).

If 64-bit then pre-built binaries of both 32- and 64-bit are available; use the 64 bit versions.

Shortcut

  1. Download sqlite-tools-win-x64-3480000.zip from here
  2. Extract the zip to a folder of your own choice.
  3. Navigate to that folder, locate SQLite3.EXE (this is the CLI) and double click.

If it starts (meaning you have a 64-bit XP), you are in luck.

Consider setting up a shortcut to the executable to enable you to start the CLI with ease.

PS: SQLite has no installation, has no dependency on the Windows registry, or Windows environment variable (notably %path%): to remove SQLite from your computer, you simply delete the folder where you extracted the ZIP file.

(5) By Florian Balmer (florian.balmer) on 2025-01-21 07:14:02 in reply to 3 [source]

We'd be glad to hear reports of getting it working, though.

I'm building SQLite as part of the Fossil SCM for Windows XP on a regular basis, both with the latest MSVC1, and with the tools from the Windows Driver Kit Version 7.1.0 (WDK7), which is still my preferred build environment for small Win32 programs on Windows 11.

Following is my patch against the SQLite core library and shell as included in Fossil by January 21, 2025:

(Note that parts of the patch just restore ANSI C-89 conformance by shoving variable declarations in front of statements; this is usually not necessary, as both SQlite and Fossil do this by policy.)

Index: extsrc/shell.c
==================================================================
--- extsrc/shell.c
+++ extsrc/shell.c
@@ -450,19 +450,21 @@
 /*
 ** Work-alike for fgets() from the standard C library.
 */
 char *sqlite3_fgets(char *buf, int sz, FILE *in){
   if( UseWtextForInput(in) ){
+#ifndef SQLITE_USE_STDIO_FOR_CONSOLE
+    DWORD nRead = 0;
+#endif
     /* When reading from the command-prompt in Windows, it is necessary
     ** to use _O_WTEXT input mode to read UTF-16 characters, then translate
     ** that into UTF-8.  Otherwise, non-ASCII characters all get translated
     ** into '?'.
     */
     wchar_t *b1 = sqlite3_malloc( sz*sizeof(wchar_t) );
     if( b1==0 ) return 0;
 #ifndef SQLITE_USE_STDIO_FOR_CONSOLE
-    DWORD nRead = 0;
     if( IsConsole(in)
      && ReadConsoleW(GetStdHandle(STD_INPUT_HANDLE), b1, sz, &nRead, 0)
     ){
       b1[nRead] = 0;
     }else
@@ -526,10 +528,13 @@
   if( !UseWtextForOutput(out) ){
     /* Writing to a file or other destination, just write bytes without
     ** any translation. */
     return fputs(z, out);
   }else{
+#ifndef SQLITE_STDIO_FOR_CONSOLE
+    DWORD nWr = 0;
+#endif
     /* One must use UTF16 in order to get unicode support when writing
     ** to the console on Windows.
     */
     int sz = (int)strlen(z);
     wchar_t *b1 = sqlite3_malloc( (sz+1)*sizeof(wchar_t) );
@@ -536,11 +541,10 @@
     if( b1==0 ) return 0;
     sz = MultiByteToWideChar(CP_UTF8, 0, z, sz, b1, sz);
     b1[sz] = 0;

 #ifndef SQLITE_STDIO_FOR_CONSOLE
-    DWORD nWr = 0;
     if( IsConsole(out)
       && WriteConsoleW(GetStdHandle(STD_OUTPUT_HANDLE),b1,sz,&nWr,0)
     ){
       /* If writing to the console, then the WriteConsoleW() is all we
       ** need to do. */
@@ -1580,10 +1584,13 @@
 **
 ** Use the C-library printf() function to convert real value X into a string.
 ** Used for comparing the accuracy of SQLite's internal float-to-text conversion
 ** routines against the C-library.
 */
+#if _MSC_VER==1500
+#define snprintf _snprintf
+#endif
 static void shellDtostr(
   sqlite3_context *pCtx,
   int nVal,
   sqlite3_value **apVal
 ){
@@ -10190,11 +10197,13 @@
 SQLITE_EXTENSION_INIT1
 #include <stdio.h>
 #include <string.h>
 #include <assert.h>
 #ifndef SQLITE_NO_STDINT
+#if _MSC_VER>1500
 #  include <stdint.h>
+#endif
 #endif

 #include <zlib.h>

 /* When used as part of the CLI, the sqlite3_stdio.h module will have
@@ -16706,10 +16715,13 @@
 }

 /*
 ** File control method. For custom operations on an vfstrace-file.
 */
+#if _MSC_VER==1500
+#define strtoll _strtoi64
+#endif
 static int vfstraceFileControl(sqlite3_file *pFile, int op, void *pArg){
   vfstrace_file *p = (vfstrace_file *)pFile;
   vfstrace_info *pInfo = p->pInfo;
   int rc;
   char zBuf[100];
@@ -23887,10 +23899,16 @@
 **
 ** No bindings occur if this table does not exist.  The name of the table
 ** begins with "sqlite_" so that it will not collide with ordinary application
 ** tables.  The table must be in the TEMP schema.
 */
+/* NOTE: Also see the `test-inf-nan.c' test program. */
+#if _MSC_VER==1500
+#pragma warning(disable : 4756)
+#define INFINITY  ((float)(1e+300 * 1e+300))
+#define NAN       ((float)(INFINITY * 0.0F))
+#endif
 static void bind_prepared_stmt(ShellState *pArg, sqlite3_stmt *pStmt){
   int nVar;
   int i;
   int rc;
   sqlite3_stmt *pQ = 0;
@@ -23938,10 +23956,13 @@
     }
     sqlite3_reset(pQ);
   }
   sqlite3_finalize(pQ);
 }
+#if _MSC_VER==1500
+#pragma warning(default : 4756)
+#endif

 /*
 ** UTF8 box-drawing characters.  Imagine box lines like this:
 **
 **           1

Index: extsrc/sqlite3.c
==================================================================
--- extsrc/sqlite3.c
+++ extsrc/sqlite3.c
@@ -14267,11 +14267,16 @@
 ** the SQLITE_DISABLE_INTRINSIC define.
 */
 #if !defined(SQLITE_DISABLE_INTRINSIC)
 #  if defined(_MSC_VER) && _MSC_VER>=1400
 #    if !defined(_WIN32_WCE)
+#if _MSC_VER==1500
+#      include <stdlib.h>
+#      include <emmintrin.h>
+#else
 #      include <intrin.h>
+#endif
 #      pragma intrinsic(_byteswap_ushort)
 #      pragma intrinsic(_byteswap_ulong)
 #      pragma intrinsic(_byteswap_uint64)
 #      pragma intrinsic(_ReadWriteBarrier)
 #    else
@@ -24985,11 +24990,15 @@
 ** localtime_s().
 */
 #if !HAVE_LOCALTIME_R && !HAVE_LOCALTIME_S \
     && defined(_MSC_VER) && defined(_CRT_INSECURE_DEPRECATE)
 #undef  HAVE_LOCALTIME_S
+#if _MSC_VER==1500
+#define HAVE_LOCALTIME_S 0
+#else
 #define HAVE_LOCALTIME_S 1
+#endif
 #endif

 /*
 ** The following routine implements the rough equivalent of localtime_r()
 ** using whatever operating-system specific localtime facility that

  1. ^ Building with the latest MSVC requires some hacks: as the MSVC runtime library increasingly makes use of Win32 API functions not available on Windows XP, I'm using the kernel32.lib import library from VC6 (or WDK7) and reimplement the few missing kernel32.dll functions in a XP-compatible way, along the lines InitializeCriticalSectionEx() → just use InitializeCriticalSection(), etc.

(6) By JyB900 on 2025-01-22 17:41:00 in reply to 1 [link] [source]

Thanks. Where can I download Sqlite and other tools for Windows XP?

(7.1) Originally by MOHAMEDMOIDEEN (AI) (MOHAMEDMOIDEEN12542) with edits by Richard Hipp (drh) on 2025-01-29 13:05:35 from 7.0 in reply to 1 [link] [source]

(This post is likely generated by an AI)

The last version of SQLite that is compatible with Windows XP is SQLite 3.8.11.1. This version was released in 2014 and is known to function properly on Windows XP SP3. Subsequent versions have introduced dependencies or features that are not supported by Windows XP, making them incompatible. For GUI tools, DB Browser for SQLite 3.9.1 is also noted to work on Windows XP, but users have reported mixed experiences with later versions due to compatibility issues related to newer libraries and frameworks used in those releases127. If you need to work with SQLite on Windows XP, it is advisable to use these older versions to ensure functionality and stability.

(8) By J-L Hainaut (JLHainaut) on 2025-02-05 17:42:56 in reply to 1 [link] [source]

After some tests, it seems that the last stable version of SQLite 32bits, i.e., v3.47.2, works perfectly under Windows XP.

Tested on a small ASUS laptop acquired in 2005 (just 20 years old!):

  • Asus M5000 Intel Pentium M 1.8 Mz, RAM 500 MB, HD 60 GB
  • Windows XP PRO 32 bits SP2, Version 2002
  • Test application in Python 2.7.9

What should we congratulate? Windows or SQLite?