HyperNext Android Creator

Finding help on HAC => Databases => Topic started by: RaspDev on June 13, 2013, 07:14:11 AM

Title: Database read-only mode?
Post by: RaspDev on June 13, 2013, 07:14:11 AM
I've successfully used DbCreateFN to create and reopen a database but cannot see how to make it open in read-only mode. Is there a way to do this?
Title: Re: Database read-only mode?
Post by: Malkom on June 13, 2013, 11:01:29 AM
I've successfully used DbCreateFN to create and reopen a database but cannot see how to make it open in read-only mode. Is there a way to do this?

Yes there is. If the database already exists then use the DbOpenFN function:-

DbOpenFN(path,mode)    - where mode = 0 for read only and 1 for read/write

eg

Code: [Select]
Local res

@ -- read only --
Put DbOpenFN(filepath,0) into res
if res=1 then
   @ -- db is open in read only mode
    ...
    ....
endif

Title: Re: Database read-only mode?
Post by: RaspDev on June 16, 2013, 05:47:25 AM
thank you.