I want to do read-only access to a SQLite database in a browser, where I get the necessary sql.js codes from the Windows folder (rather than a server) where the database is housed.
Is this possible and, if so, how? I could show you 'my code' in the time-honoured way but nothing gets close.
Yes it is possible. The HTML and JavaScript sample below works on my localhost web server. These two references helped me find the answer:
Example: Using object URLs to display images
Implement SQLite on web with JavaScript — both Node & Browser with sql.js plugin
I combined parts of both references to create the sample. Please note that the
sql-wasm.wasmandsql-wasm.jsfiles are expected to be in the same directory as the HTML and JavaScript files. I hope the demo explains itself. If you have problems making it work, post a comment and I will try to provide it online somewhere.index.html
sqljs-import.js