Skip to main content
Known Participant
August 14, 2012
Question

SQL read-only

  • August 14, 2012
  • 2 replies
  • 973 views

Hey

I make a app with SQLLite.

But if I try a insert our update show me a error with not have permission to write de DB. only ipad. On machine works perfect.

Here my code:

dbFile2 = File.applicationDirectory.resolvePath("Documents/base.db");

                       

            if (dbFile2.exists)

            {

                conn = new SQLConnection();

                conn.addEventListener(SQLEvent.OPEN, openHandler);

                conn.open(dbFile2);

            }

           

            else

            {

                trace("Don't exist")

            }

Error:

SQLError: 'Error #3122: Attempt to write a readonly database.', details:'attempt to write a readonly database', operation:'execute', detailID:'2411'

    at flash.data::SQLStatement/execute()

Any one have some issue?

tanks

Bruno Brustoloni e Oliveira

This topic has been closed for replies.

2 replies

mbhagya
Participating Frequently
August 14, 2012

Hey,

File.applicationDirectory is a read only directory.

You'll have to copy your file to File.documentsDirectory to use the database.

See this page for an example.

-mayank

Known Participant
August 14, 2012

tks

I try use this.