database - how to open sqlite3 db through javascript? -


i using https://github.com/kripken/sql.js plugin open sqlite db js

<script> function print(text) {   var element = document.getelementbyid('output');   element.innerhtml = text.replace(/\n/g, '<br>'); }  var db = sql.open('fixtures/db/development.sqlite');  // run command in database function execute(commands) {   try {     var data = db.exec(commands.replace(/\n/g, '; '));     print(json.stringify(data, null, '  '));     print(data);   } catch(e) {     print(e);   } } 

, getting error "sqlite exception: 26, file encrypted or not database". there problem opening sqlite file?

grant web server access folder storing sqlite file.

for example, if iis, grant user 'iis apppool\defaultapppool' modify access sqlite database file or containing folder. user doesn't show in user searches, if paste name , click 'check names' when granting privileges using windows explorer allow user selected.

if apache, you'll need consider chmod change permissions.

for both web servers file extension needs allowed. in iis, may need add mimetype .sqlite.


Comments

Popular posts from this blog

c# - SelectList with Dictionary, add values to the Dictionary after it's assigned to SelectList -

how can i manage url using .htaccess in php? -

ios - I get the error Property '...' not found on object of type '...' -