Static IP address path



I am trying to access an sqlite file on a local area network server located in “sqlite” folder, on windows file explorer I access it using the IP address “”, however when the electron aplication tries to access it, the path is converted to the local machine path “c:/application …/192.168 …”.

please how can I just point the file directly using the static IP adress without converting it to local machine path?


Have you tried explicitly setting the protocol with http://?


yes it convert it back to c:/application/ …/http://


You might have to share your code to provide more context.


// login_app.js

var route = require(’…/…/libs/router.js’); //my lib

var dbPath = “” // here is the problem

function login() {
var email = document.getElementById(“email”).value;
var password = document.getElementById(“password”).value;

if(email == "" || password == ""){
    alert("Please Enter Your email & Password ...");
} else{
    var sql = require('sql.js');                            //Import sqLite 
    var fs = require("fs");                                 //Import Files driver

    var SHA256 = require("crypto-js/sha256");              	//Crypting Library

    try {
        var filebuffer = fs.readFileSync(dbPath);			//here it converts the file to lical machine

        if (filebuffer != null) {
            var db = new SQL.Database(filebuffer);
        } else {
            var db = new SQL.Database();
            console.log("No Database");

        // Prepare an sql statement
        var stmt = db.prepare("SELECT * FROM users WHERE email=:emailid");

        // Bind values to the parameters and fetch the results of the query
        var result = stmt.getAsObject({':emailid' : email});
        if(result.password == null) alert('Account not existing, please contact Your Administrator ...');
            if(SHA256(password) == result.password) {

            else alert('Wrong Login credentials, please try again ...');

    } catch (e) {




I suspect that the problem is that you’re using fs when you should be using http or https.


but in order to use sql.js I need to use fs, is there any other way to read sqlite database without fs??


I am not sure how to explain you that, but it is not apache server, it just a computer with shared folders


You’re accessing a different computer via an IP address. fs seems to be getting confused about that.

More broadly, I’m not sure how this problem has anything to do with Electron. Maybe you should be looking at forums with broader communities of Node developers and asking them if they’ve done work accessing databases on remote machines. Alternatively, you could mount the remote machine as a drive with an SSHFS and use fs with that.


It is so simple, I just had to use double slash “//” and it worked fine:

var dbPath = “//”;

Thank you for your time.


Glad you found something that worked. :slight_smile: