I'm confused at this. This is so simple to do. If you have an external form file, you create 2 custom form actions, one to connect to a database and one to disconnect from the database. At the beginning of every menu option from your form you make a call to the connect CFA, and at the end of every option you make a call to the disconnect CFA. Even though it may seem silly to create a CFA to do a connect or disconnect, this makes it easy if you decide later on not to do it. You can leave the calls to the CFAs in there, and just put a "return" at the top of each CFA so they don't do anything. That's the way we did it, and it's really easy to do. As I mentioned, we ended up eventually disabling it because users complained about the speed and we didn't have any corruption issues anyway.
Karen -----Original Message----- From: Tom Frederick <[email protected]> To: RBASE-L Mailing List <[email protected]> Sent: Wed, Nov 6, 2013 8:05 am Subject: [RBASE-L] - Re: compiled apps best practice Razzak, I would also be interested. Tom Frederick President/CEO Elm City Center 1314 W Walnut Jacksonville, IL 62650 W- 217-245-9504 F - 217-245-2350 E - [email protected] -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Stephen Markson Sent: Wednesday, November 06, 2013 7:57 AM To: RBASE-L Mailing List Subject: [RBASE-L] - Re: compiled apps best practice Hi Razzak, I would be interested in this application, too. Regards, Stephen Markson The Pharmacy Examining Board of Canada 416.979.2431 x251 -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of A. Razzak Memon Sent: November-05-13 2:09 PM To: RBASE-L Mailing List Subject: [RBASE-L] - Re: compiled apps best practice At 01:58 PM 11/5/2013, Dan Goldberg wrote: >Thanks for the info. I see the form action to connect to the database >but should I have one at the end of my code to disconnect from the database? Dan, Let me send you a cool application using the External Form File (.rff) to illustrate everything you need to know. Have fun! Very Best R:egards, Razzak >-----Original Message----- >From: A. Razzak Memon >Sent: Tuesday, November 05, 2013 10:37 AM >To: RBASE-L Mailing List >Subject: [RBASE-L] - Re: compiled apps best practice > >At 12:48 PM 11/5/2013, Dan Goldberg wrote: > > >I am trying to figure out the best practice for compiled apps. > > > >I have a compiled app that users open. It is an external form file > >that is ran. > > > >The question is should I: > > > >1. connect to the database when they open the app and leave it > >connected until > > they close the app. > > > >or > > > >2. open the app and stay disconnected. When they click on something > >on the app, > > connect to the database, process, and when it is done disconnect. > > > >Right now I use option 1 but from time to time the database gets > >corrupted. I am thinking maybe to do option 2 but do not know how > >that will work or if it will solve the corruption problem. > > >Dan, > >Excellent question! > >Let me send you a personal invite to www.join.me/RazzakMemon to show >you the practical approach and advantages of using option #2 to deploy >an R:Compiled R:BASE eXtreme 9.5 (32/64) application in a multi-user environment. > >Using this approach you may also include all database maintenance and >backup routines in External Form File (.rff), if you wish. > >Technically, you will have to define a Custom Form Action in External >Form File, for example: > >-- Custom Form Action: CheckDBConnection (Check Database Connection) > >IF (CVAL('DATABASE')) <> 'RBU_SAT' OR (CVAL('DATABASE')) IS NULL THEN > CONNECT RBU_SAT IDENTIFIED BY NONE ENDIF RETURN > >Then, add the following code for each TreeView Node, TreeView Item, >Button, etc., that involves the database connection. > >PROPERTY RBASE_FORM_ACTION CheckDBConnection ' ' >-- continue with the code ... > >Hope that helps! > >Feel free to reach out to me with any questions. > >Very Best R:egards, > >Razzak > >www.rbase.com >www.facebook.com/rbase >-- >30+ years of continuous innovation! >15 Years of R:BASE Technologies, Inc. making R:BASE what it is today! >--

