Error: Can't create DB

You must Login before you can answer or comment on any questions.

Below is the error I'm getting

[ERROR] Script Error = Could not retrieve attributes. Error Domain=NSCocoaErrorDomain Code=260 "The operation couldn’t be completed. (Cocoa error 260.)" UserInfo=0xac78000 {NSFilePath=/Users/Blake/Library/Application Support/iPhone Simulator/6.0/Applications/2225E506-D9F5-4DC5-B099-32A0FE2030C3/myApp.app/db/ticklers.db, NSUnderlyingError=0xac77a00 "The operation couldn’t be completed. No such file or directory"}  in -[TiDatabaseProxy install:name:] (TiDatabaseProxy.m:126) at db.js (line 16)
The line of code it's referring to (starting at line 15):
self.openDB = function() {
        return Ti.Database.install('/db/myDB.db', 'theMagicdb');
    };
I don't know why it won't create the directory and the db... that's what I would guess that this does.

2 Answers

Accepted Answer

Fist test if you original database is where you "expect" to be... I spent like 1 day chasing my original sqlite database.

var whereisWalDB=Ti.Filesystem.getFile("/db/myDB.db"); Ti.API.warn('here is the m... fu..: "+whereisWalDB.nativePath+" size:"+whereisWalDB.size);

If size = -1 or 0 you haven't found your original database....

After you find it, everything is as expected.

— answered 7 months ago by Andrés Tello
answer permalink
1 Comment
  • Looks like the db doesn't exist and I have no idea where it is. The previous developer didn't give it to me I don't think. Is there a way to recreate a db?

    — commented 7 months ago by Blake Rogers

Your Answer

Think you can help? Login to answer this question!