SQLite file not selectable

I wanted to open with OpenDialog (an old project) a SQLite file and it was grey (not selectable)…

I add with Xojo 2021r2.1 a new FileType, drop my sqlite file, then add the found Identifier in my previous file definition and run: same behavior.

I commented the Filter Property of OpenDialog, run and was able to open my file.

The File Type is as:

I checked / uncheked “File type is unique to this application, but that changes nothing: I was unable to choose the SQLite file.

Why not just allow all files whether or not they have an extension?

To avoid a stupid guy (starting with me) to be able to open “any” file.

After all, the purpose of the File Extension (and File Type) is that: avoid opening a data base file as if it is an image (and avoid the following crash).

AIUI, SQLite will detect that its not an SQLite database on first read or write and give you a “not a database” error.

What happens if Stupid Guy takes a jpeg and changes its extension? You still have to handle the crash.

No, because I check the “magic number“ in the file; jfif if my memory serve.

But, you are right, nothing is 100% idiot proof.

SQLite database has:

SQLite format 3\000

in the first 16 bytes.

1 Like

and the complete information is:

Screen shot of the application I was talking in this thread…

That data base file have been modified 10519 times… (since 2013 I think).