Author Topic: Database read-only mode?  (Read 6303 times)

RaspDev

  • Newbie
  • *
  • Posts: 3
Database read-only mode?
« 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?

Malkom

  • Administrator
  • Sr. Member
  • *****
  • Posts: 289
Re: Database read-only mode?
« Reply #1 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

I am sorry but I do not have time to answer questions by PM or email.
If you post your questions in this forum then it might help others.

RaspDev

  • Newbie
  • *
  • Posts: 3
Re: Database read-only mode?
« Reply #2 on: June 16, 2013, 05:47:25 AM »
thank you.