本文介绍了获取Sqlitelog(23)未授权的错误,而在Android版的PhoneGap选择查询.....的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创造我所执行的选择,以获得访问权限上,我想运行另一个选择查询权利的基础的应用程序。但是,尽管这样做了给我(23)在logcat的未授权错误。

I am creating an app in which I have executing an select to get the access rights an base on the rights i want to run another select query. But while doing this its giving me (23) not authorized error in the logcat.

var checkAccessQuery = "select * from ug_access where ug_id = '"+window.localStorage.getItem("roleId")+
                     "' and f_id = "+window.localStorage.getItem("module_id")+" and comp_code = "+window.localStorage.getItem('companyCode')+"";
 var query1 = '';
var moduleId ='';
var pkId ='';
$(function(tx){
 db.transaction(function(tx){
    tx.executeSql(checkAccessQuery,[],function(tx,results){
        var dataset = results.rows.length;
        if(dataset>0)
        {

        }else{
            window.localStorage.setItem('accessDenied',true);
            window.location.href = 'home.html';
        }
        console.log('value in module_id: '+window.localStorage.getItem('module_Id'));
        window.localStorage.setItem('sessionModuleId',window.localStorage.getItem('module_Id'));
        var innerModule  = 0;
        if(window.localStorage.getItem('innerModule') != 'undefined' || window.localStorage.getItem('innerModule') !=''  )
        {
            innerModule = window.localStorage.getItem('innerModule');
        }
        moduleId = 0;
        if(window.localStorage.getItem('module_Id') != 'undefined' || window.localStorage.getItem('module_Id') != '' )
        {
            moduleId = window.localStorage.getItem('module_Id');
        }
        pkId = 0;
        if(window.localStorage.getItem('pkIdDelete') != 'undefined' || window.localStorage.getItem('pkIdDelete') != '')
        {
            pkId = window.localStorage.getItem('pkIdDelete');
        }

        if(pkId !=0)
                {
tx.executeSql('select * from user_form',[],function(tx,result){
var dataset = result.rows.length;
console.log('length of the dynamic_form: '+dataset);
});
        }
    });
 },errorCb,sucessCb);


});

谁能帮我理清这个问题。
任何想法是AP preciated ..
先谢谢了。

Can anyone help me to sort out this problem.Any Idea is appreciated..Thanks in advance.

推荐答案

这是不是解决sqlite的23无权错误很好的解决方案。

This is not a good solution for solving sqlite 23 not authorized error.

db.transaction(function(tx){
tx.executeSql(checkAccessQuery,[],function(tx,results){
    var dataset = results.rows.length;
    if(dataset>0)
    {

    }else{
        window.localStorage.setItem('accessDenied',true);
        setTimeout(function() {
            window.location.href = 'home.html';
        }, 1500);

    }
});

这篇关于获取Sqlitelog(23)未授权的错误,而在Android版的PhoneGap选择查询.....的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 03:20