Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/474.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 以Excel电子表格作为数据库的Electron Python应用程序:使用npm包-Database js xlsx进行CRUD操作_Javascript_Python_Node.js_Excel_Electron - Fatal编程技术网

Javascript 以Excel电子表格作为数据库的Electron Python应用程序:使用npm包-Database js xlsx进行CRUD操作

Javascript 以Excel电子表格作为数据库的Electron Python应用程序:使用npm包-Database js xlsx进行CRUD操作,javascript,python,node.js,excel,electron,Javascript,Python,Node.js,Excel,Electron,我正在编写这个软件包,用于在Electron Python框架中开发一个以Excel电子表格为数据库的应用程序 我在错误下面 **(node:14796) UnhandledPromiseRejectionWarning: RangeError: Invalid string length at ..\node_modules\database-js-xlsx\index.js:507:63 (Use `node --trace-warnings ...` to show where the w

我正在编写这个软件包,用于在Electron Python框架中开发一个以Excel电子表格为数据库的应用程序 我在错误下面

**(node:14796) UnhandledPromiseRejectionWarning: RangeError: Invalid string length
at ..\node_modules\database-js-xlsx\index.js:507:63
(Use `node --trace-warnings ...` to show where the warning was created)
(node:14796) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:14796) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.**
当我尝试点击节点--unhandledRejections=strict.js时

    **..\node_modules\database-js-xlsx\index.js:507
                            sql = sql.substr(0, err.offset) + '.' + sql.substr(err.offset + 1);
                                                                  ^
    RangeError: Invalid string length** 
有人能帮我吗

下面是我的代码

**var database = require('database-js-xlsx/index');
var connection = database.open({ Database: 'yields.xlsx' });
function handleError(error) {
    console.log("ERROR:", error);
    process.exit(1);
}
connection.query("SELECT a,b FROM Sheet1$A1:C4 Where c= 'Apples' ").then((data) => {
    console.log(data[0].a)
    if (data.length != 1) {
        handleError(new Error("Invalid data returned"));
    }
    else{
        console.log(data)
    }
    connection.close().then(() => {
        process.exit(0);
    }).catch(handleError);
}).catch(handleError);**

提前感谢。

您是否尝试过从表1中选择a、b,其中c=‘苹果’

此外,我得到的印象是,专栏应该命名,而不是地址

因此,如果a、b、c是您的列名,我希望它们被标记在您的第一行。你就是这样吗?这件事我不确定