Page 1 of 1

Password Page

PostPosted: Fri Jun 24, 2016 5:57 pm
by BRobinsonS
I have tried using the First page of my app as a Password Page.
I keep the choice to use or not use a password in a table.
If the DBPro database / Table indicates I am not using a password, I want to not show/skip the first (password) page.

I have put the code in the Book Actions but the password page wants to momentarily display before going to the page past the password page.
Code: Select all
  FileExists "[PubDir]AddressBook.mdb" "[Result]"
  If "[Result]" "=" "True"
    dbpOpenAccessDatabase "AddrBook" "[PubDir]AddressBook.mdb" ""
. open Branch table to check password
    dbpOpenTable "AddrBook" "Branch" ""
. if using password to to password page, else continue
    If "[AddrBook.Branch.UsePswd]" "=" "True"
     GotoPage "PasswordPage"
    Else
      GoSub "DatabaseOpen"
      GotoPage "Entry Screen"
    EndIf
  Else
    GoSub "CreateDB"
  EndIf


Is there any way to prevent this first page showing?

Re: Password Page

PostPosted: Fri Jun 24, 2016 9:00 pm
by Gaev
Brian:

Try placing the same code in the PageEnter section of the first (i.e. PasswordPage) page ... you won't need the command ...
Code: Select all
GotoPage "PasswordPage"

... as you are already on this page.


If it still shows the contents of the page for a split second ...

a) Add a page before the current first (i.e. PasswordPage) page ... call it Intro ... you can keep it empty ... or have some kind of Welcome message.

b) place your code in the PageEnter section of Intro ... you will need to add ...
Code: Select all
     GotoPage "PasswordPage"
... after ...
Code: Select all
    GoSub "CreateDB"



Many (many) moons ago, I was told that the sequence at run time is ...

a) show the objects of the first page
b) service the PageEnter section of the first page
c) service the StartUp section of the publication

Re: Password Page

PostPosted: Sat Jun 25, 2016 7:41 am
by BRobinsonS
Interestingly enough I moved the Password Page to the last page.
I works satisfactorily now.
i.e. If there is no password being used, it goes to my 'Entry Screen' (the original first page).
If a password being used, the password page covers the 'Entry Page' (or replace it) and is asking for a password.

The app seems to be working as expected so I didn't mess up my app by introducing a password and moving the code around.

Gaev, thanks for your thoughts as always.