login form w/ database

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
lemodizon
Posts: 175
Joined: Thu Apr 05, 2018 3:33 pm

login form w/ database

Post by lemodizon » Wed Sep 15, 2021 8:06 am

Hello everyone,

I want to try this in livecode coz I saw in my friend application (vb6). Once the application load it will ask where the database is location and once the user locate the database it will restart. Then it will go to the login form. I noticed that once the database is found the application will not go to the step 1 which is to find the database. Is this possible in livecode? Does anyone here did this before. Hope you can guide me thanks in advance
Attachments
Capture.JPG
Thank you & God Bless Everyone :wink:

Regards,
lemodizon

stam
Posts: 2679
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: login form w/ database

Post by stam » Wed Sep 15, 2021 9:16 am

Hi Lemodizon,

What you describe should be very easy to implement I'd imagine.

You would need to create a permanent storage for the file path to the database file (either store in a writeable stack or in a file that is read on start up). If the file path info is empty then go to 'localise db' layout (card or group).
If the file path info is not empty, then check the database file exists, if not then go to 'localise db' layout
Once you have a valid file path, store it in your permanent storage.
Then go to login layout (card or group).

Seems straightforward?

Stam

--- edit ---
I just noticed from what you've written that you may not be intending to store a file path, in which case it's even simpler.
Personally i would normally keep all of this on the same card, but group controls for locating the database into one group, then the controls for logging in in another group and would show/hide groups depending on whether there is a valid file path to a database file - but should be no different if you did on separate cards though.

If you're struggling with the code, post what you've done so far and you'll probably get a lot of responses with help ;)

Bernard
Posts: 351
Joined: Sat Apr 08, 2006 10:14 pm
Location: London, England

Re: login form w/ database

Post by Bernard » Wed Sep 15, 2021 11:35 am

lemodizon wrote:
Wed Sep 15, 2021 8:06 am
Once the application load it will ask where the database is location and once the user locate the database it will restart. Then it will go to the login form. I noticed that once the database is found the application will not go to the step 1 which is to find the database. Is this possible in livecode?
I'm not sure that you want your app to quit and restart (I can't think of any normal reason you would want this). Attached is a stack where card 1 is the "find database" window and card 2 is the "login" window. You can see that the database path has been passed from card 1 to card 2 (I assume what you want is to use the database path combined with username & password to effect the login). In this stack you can return to card 1 by clicking on the text below "chosen db path" (where you can then change the db path and see it updated on cd 2).

If you really do need the app to quit and restart, please explain why that is needed.
Attachments
Untitled 1.livecode.zip
(1.51 KiB) Downloaded 91 times

lemodizon
Posts: 175
Joined: Thu Apr 05, 2018 3:33 pm

Re: login form w/ database

Post by lemodizon » Wed Sep 22, 2021 10:48 am

Bernard wrote:
Wed Sep 15, 2021 11:35 am
lemodizon wrote:
Wed Sep 15, 2021 8:06 am
Once the application load it will ask where the database is location and once the user locate the database it will restart. Then it will go to the login form. I noticed that once the database is found the application will not go to the step 1 which is to find the database. Is this possible in livecode?
I'm not sure that you want your app to quit and restart (I can't think of any normal reason you would want this). Attached is a stack where card 1 is the "find database" window and card 2 is the "login" window. You can see that the database path has been passed from card 1 to card 2 (I assume what you want is to use the database path combined with username & password to effect the login). In this stack you can return to card 1 by clicking on the text below "chosen db path" (where you can then change the db path and see it updated on cd 2).

If you really do need the app to quit and restart, please explain why that is needed.

Hi Bernard,

Thanks for the response.. I just saw the application from my friend and i don't know why his application is like that :D . anyways thanks and stay safe
Thank you & God Bless Everyone :wink:

Regards,
lemodizon

lemodizon
Posts: 175
Joined: Thu Apr 05, 2018 3:33 pm

Re: login form w/ database

Post by lemodizon » Wed Sep 22, 2021 10:52 am

stam wrote:
Wed Sep 15, 2021 9:16 am
Hi Lemodizon,

What you describe should be very easy to implement I'd imagine.

You would need to create a permanent storage for the file path to the database file (either store in a writeable stack or in a file that is read on start up). If the file path info is empty then go to 'localise db' layout (card or group).
If the file path info is not empty, then check the database file exists, if not then go to 'localise db' layout
Once you have a valid file path, store it in your permanent storage.
Then go to login layout (card or group).

Seems straightforward?

Stam

--- edit ---
I just noticed from what you've written that you may not be intending to store a file path, in which case it's even simpler.
Personally i would normally keep all of this on the same card, but group controls for locating the database into one group, then the controls for logging in in another group and would show/hide groups depending on whether there is a valid file path to a database file - but should be no different if you did on separate cards though.

If you're struggling with the code, post what you've done so far and you'll probably get a lot of responses with help ;)
Hi Stam,

Thanks for the response I will try to create one and if i struggle in my code i will post it here. thanks and stay safe
Thank you & God Bless Everyone :wink:

Regards,
lemodizon

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”