-
19 Feb 2010 4:16 AM #11
SQLite version - Air version ??
SQLite version - Air version ??
Hello Makana,
Thank you for your input. When using 2 it signals the relational database to sort by #2. This si within the table structure and references the column_id.
I'm still getting the same issue, and the onyl thing I can think of is what version of SQLite are you using.
I started up the SQLite Manager and I see version 3.6.16.1. This is just about the only thing I can think of. Otherwise, I'm going to shutdown this old cow struggling to run aptana.
Also, Makana, can you tell me which version of Air you are running? I'm running Beta 2.0. But if one of my comboxes has not problem accessing SQLite, and don't see the relation, but nonetheless, good to know what versiosn we are running.
Thanks for your assitance.
Jackl
-
23 Feb 2010 12:57 AM #12
SQLite Store - views/tables and rowid?
SQLite Store - views/tables and rowid?
Hello,
So I'm still unable to query the views I've created in my SQLite database. After some searching, I've ntoiced tha tthe only difference between a table and a view is that SQlite adds a system rowid. Could this play a role?
Also, could some some please explain what Ext means by this :
/**
* @class Ext.sql.SQLiteStore
* @extends Ext.data.Store
* Convenience class which assists in setting up SQLiteStore's.
* This class will create the necessary table if it does not exist.
* This class requires that all fields stored in the database will also be kept
* in the Ext.data.Store.
*/
Thanks Jack
ps - driving to have a view based combobox by weeks' end.
-
23 Feb 2010 1:27 AM #13
Hello All,
I've added the row id to my view, removed the createTable function and still nothing:
I simply keep getting the following:
This suggests that SQLiteStore load action doesn't like something about the store a params?Code:ReferenceError: Error #1056: Cannot create property stackTrace on flash.errors.SQLError. at app:/lib/ext/ext-all-debug.js : 32265 at app:/lib/ext/ext-all-debug.js : 58267 at app:/lib/ext/ext-all-debug.js : 58349 h at app:/lib/ext/ext-all-debug.js : 2646 undefined at undefined : undefined
I guess I'm run ning out of ideas here. And the sad part is that its holding up my entire development.Code:load : function(options) { options = options || {}; this.storeOptions(options); if(this.sortInfo && this.remoteSort){ var pn = this.paramNames; options.params = options.params || {}; options.params[pn.sort] = this.sortInfo.field; options.params[pn.dir] = this.sortInfo.direction; } try { return this.execute('read', null, options); // <-- null represents rs. No rs for load actions. } catch(e) { this.handleException(e); // line 32265 return false; } }
Thanks in advance for all thoise who can help.
Jack
-
23 Feb 2010 1:38 AM #14
I saw the same error in my program some time ago. But I can't remeber how I fixed it. Post your SQLiteStore code. And try to debug your app - maybe there is a SQL-error...
-
23 Feb 2010 3:40 AM #15
Hello Pranke,
Its the same declaration as in the modified ext-air-debug created by Makana. My store is declared as:
We should be sure that this works with views, otherwise we can't say that SQLiteStore supports access to views:Code:store: new Ext.sql.SQLiteStore({ conn: iApplication.module.DB ,api:{create:false,update:false,destroy:false} ,tableName: 'VW_COUNTRY_ADMINS' ,key: 'ADMINISTRATOR_ID' ,fields: [{name: 'id', type: 'string', mapping:'ADMINISTRATOR_ID'} ,{name: 'text', type: 'string',mapping:'ADMINISTRATOR_NAME'} ] })
SQlite Version: 3.6.16.1
-
23 Feb 2010 3:51 AM #16
Where is the SQLite version from? You don't need to install anything, but Adobe Air. How are you creating the iApplication.module.DB ?
And what about the debugging? Are the generated SQL-commands okay?
-
23 Feb 2010 4:20 AM #17
Hello Pranke,
I have 3 other comboboxes that are using stores such as this one. The only difference is that they are based on views.
When I keep on debuging and the next this is the dailing line 58267 whihc points once again to the load method:
And the final part points to the combobox's triggerAction propertyCode:}else{ this.store.baseParams[this.queryParam] = q; this.store.load({ params: this.getParams(q) });
Code:onTriggerClick : function(){ if(this.readOnly || this.disabled){ return; } if(this.isExpanded()){ this.collapse(); this.el.focus(); }else { this.onFocus({}); if(this.triggerAction == 'all') { this.doQuery(this.allQuery, true); } else { this.doQuery(this.getRawValue()); } this.el.focus(); } }
Still nothing. All this is not a problem went the its actually a table and not a View. I'm using SQLiteManager Add-On from Firefox.
-
23 Feb 2010 5:37 AM #18
"Error #1056: Cannot create property stackTrace on flash.errors.SQLError."
As you see, it is an sql-error. So I don't think the problem is the ext.js.
What IDE are you using for debugging? Run your application in debug-mode and you will see, where the error occurs and what the SQL-Error exactly is. I think you will also see the generated sql command, which causes the error!
-
23 Feb 2010 6:09 AM #19
SQLiteStore - Doesn't recognize VIEWS in SQLite DB
SQLiteStore - Doesn't recognize VIEWS in SQLite DB
Hello All,
I think that there is something wrong with the SQLiteStore when it comes to accessing a VIEW. It simply does not recognize it.
Here is how to reproduce the errors I've been getting :
Now for the SQL Tbale and views:Code:iApplication.module.comboAdmins = Ext.extend(Ext.form.ComboBox, { initComponent: function() { Ext.apply(this, { store: new Ext.sql.SQLiteStore({ conn: iApplication.module.DB //or use dbFile - up to you ,api:{create:false ,update:false ,destroy:false } ,tableName: 'vw_admins' ,key: 'id' ,fields: [{name: 'id', type: 'int'} ,{name: 'text', type: 'string'} ] }), valueField: 'id' ,displayField: 'text' ,triggerAction: 'all' ,emptyText:'Select Employee...' ,width: 160 ,fieldLabel: 'Employee' ,lazyRender: true }) iApplication.module.comboAdmins.superclass.initComponent.apply(this, arguments); } }); Ext.reg('combo-admins', iApplication.module.comboAdmins);
The just add xtype:'combo-admins' to any panle and you should get the following error:Code:CREATE TABLE "ORI_ADMINISTRATORS" ("ADMINISTRATOR_ID" INTEGER,"ADMINISTRATOR_NAME" TEXT,"ADMINISTRATOR_TYPE" TEXT); insert into ORI_ADMINISTRATORS values (1,'Jack Johnson','DATABASE'); insert into ORI_ADMINISTRATORS values (2,'Jamal Stevens','DATABASE'); insert into ORI_ADMINISTRATORS values (3,'Tom Brown','ONLINE'); insert into ORI_ADMINISTRATORS values (4,'Peter Smit','DATABASE'); CREATE VIEW "vw_admins" AS SELECT ADMINISTRATOR_ID as 'id', ADMINISTRATOR_NAME as 'text' FROM ORI_ADMINISTRATORS WHERE ADMINISTRATOR_TYPE = 'DATABASE' ORDER BY UPPER(ADMINISTRATOR_NAME);
After getting this error, it basically suggests that the recordset rs is null and therefore no recordset exists for the load action.Code:ReferenceError: Error #1056: Cannot create property stackTrace on flash.errors.SQLError. at app:/lib/ext/ext-all-debug.js : 32265 at app:/lib/ext/ext-all-debug.js : 58267 at app:/lib/ext/ext-all-debug.js : 58349 h at app:/lib/ext/ext-all-debug.js : 2646 undefined at undefined : undefined
IDE: Aptana 2.0
Air: 2.0 Beta
SQlite: 3.6.16
Thanks Jack
-
23 Feb 2010 6:27 AM #20
Aptana has great debugging features. Why don't you just run the debugger and check, which sql-command is generated and which error is thrown?
Set a breakpoint on line 33193 of the ext-all-debug.js. On line 33204 look what's inside the variable "e".


Reply With Quote