Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
sqlite3 runtime error — Gideros Forum

sqlite3 runtime error

igrishaevigrishaev Member
edited June 2012 in Bugs and issues
Hi!
I'm trying to get data from sqlite3, but takes an MS VC++ runtime error. Screenshot: http://min.us/mbcZvTEP1F
Tested at 3 machines with windows 7 (both 32 and 64 bit).
Gideros 2012.2.2.2
Tagged:

Comments

  • Same situatin in XP emulator =(
  • atilimatilim Maintainer
    edited June 2012
    Hi,

    I've created a simple example and it worked without a problem. I'm attaching the project.

    Here I created a test table and inserted some values:
    $ sqlite3 db.sqlite
    SQLite version 3.7.10 2012-01-16 13:28:40
    Enter ".help" for instructions
    Enter SQL statements terminated with a ";"
    sqlite> create table test(num1,num2);
    sqlite> insert into test values(1,11);
    sqlite> insert into test values(2,22);
    sqlite> insert into test values(3,33);
    sqlite> .quit
    And executed this Lua code:
    require "lsqlite3"
     
    print("sqlite3 version: "..sqlite3.version())
     
    local db = sqlite3.open("db.sqlite")
     
    for r in db:nrows("select * from test") do
    	print(r.num1, r.num2)
    end
     
    db:close()
    And this is the output on Windows 7
    sqlite3 version: 3.7.10
    1	11
    2	22
    3	33
    Can you run the attached project? or maybe your db is corrupted?
    zip
    zip
    sqlite.zip
    1K
  • atilimatilim Maintainer
    Also I realized that previously you've asked if sqlite is available on Android or not. Currently not but I'm working on it.
  • atilim, it works now!
    The problem's solved by adding db file to project.
    When db not in projects file list, connection is possible, but quering crashes.
    I'm Just add db to project, and selecting OK.
  • atilimatilim Maintainer
    great :) crashing is somewhat weird but most probably it's because of SQLite or LuaSQLite3.
  • The screenshot in post is bad, becose file list is cropped. If I uploads full screenshot, crash reason will be solved directly.
  • atilimatilim Maintainer
    edited June 2012
    I see. afaik, when the db file doesn't exit, SQLite tries to create an empty one. On the other hand, resource directory is readonly. Combination of these two results in crashing instead of a meaningful error.
  • atilimatilim Maintainer
    edited June 2012
    still crashes when I create the db as
    local db = sqlite3.open("|D|db.sqlite")
    anyway, it's a bug of LuaSQLite3 and it crashes when the corresponding table doesn't exists when you call nrows function.
  • pykasopykaso Member
    And what about Android support ??
Sign In or Register to comment.