Mike - yes it does (HTH), and thank you for this example of ON CONNECT and its usage!
Brad Davidson -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Mike Byerley Sent: Tuesday, April 27, 2010 10:46 AM To: RBASE-L Mailing List Subject: [RBASE-L] - Re: ON CONNECT (was - RE: Strange problem?) Well my interest in getting ON CONNECT to behave in a meaningful way goes back nine years ago when I had a project to upgrade and fix a quotation application for a domestic bird watering company that distributes its' product world wide. Since the Quotation application had to be maintained on user Laptops at disparate locations around the globe, there was little to no opportunity for the sales persons to interact with anyone in the home office in the event they accidentally deleted or changed file or directory structure within which the application was dependent. Many of the sub routines that the app depended upon were VBScripts that were located in thier own folder as well as some graphics and other files that also resided within their own folders. The daily backup, db file integrity and so on were also maintained in their particular directory structure. For the application to always behave reliably, a startup routine that checked for the existence of the disk files and directory structure was manditory. Every external file that was required was stored in the db as VarChar, so if any file was missing on disk, it would be replicated in the startup routine and the same for the requisite directory structure. In the beginning this startup routine was run from a codelocked DAT file that was specified with the command line in the desktop icon. It was the vulnerability of this icon that set in motion to get ON CONNECT to work reliably. Now you have to remember ON CONNECT has more than one trick up its' sleeve. There is ON FIRST CONNECT that you would use for a routine that you would do to take care of the chores of DB maintenance, since you wouldn't repeat that activity _each time_ a user connected. You would use ON BEFORE CONNECT to perform the Integrity Check or any other chore that you can't do after connection. If you want to bypass the replication of this activity by subsequent connections, you set a variable to check after you connect and then update a table in the DB with appropriate data (DateTime or such). ON AFTER CONNECT, I haven't found a personal use as yet. The generic ON CONNECT is where I ran all the aforementioned File and Directory structure checks in the stand-alone application using the RUN SELECT attribute. In the RUN SELECT, I can set all the Global Vars and in the latest and greatest, I can set all the STDCALL declarations for any APIs I want to run in the session. HTH ----- Original Message ----- From: "Brad Davidson" <[email protected]> To: "RBASE-L Mailing List" <[email protected]> Sent: Tuesday, April 27, 2010 10:34 AM Subject: [RBASE-L] - ON CONNECT (was - RE: Strange problem?) > Mike, > I'm curious, and if you will, how else do you use the ON CONNECT command > other than performing a AUTOCHK on the DB before connecting. You mentioned > following with a RUN SELECT statement (which I use independently > throughout > my applications), but, since you think this feature so useful I sure would > like some generic understanding how else I may take advantage of this. I > appreciate your thoughts on this - thanks in advance. > > Brad Davidson > > > > -----Original Message----- > From: [email protected] [mailto:[email protected]] On Behalf Of Mike > Byerley > Sent: Monday, April 26, 2010 3:04 PM > To: RBASE-L Mailing List > Subject: [RBASE-L] - RE: Strange problem? > > > ----- Original Message ----- > From: "Emmitt Dove" <[email protected]> > To: "RBASE-L Mailing List" <[email protected]> > Sent: Monday, April 26, 2010 5:56 PM > Subject: [RBASE-L] - RE: Strange problem? > > > <snip> > >> If you want daily archives made, then write some code that executes "on >> connect" to check and see if the day's archive has been made, and if not, >> do >> it. >> > > I was wondering how many people utilize the ON CONNECT <do something> > feature of RBase since it is working so wonderfully. > > I have utilized this since its inception and find it helps immeasurably to > keep things in order. > > I am really fond of ON CONNECT RUN SELECT. > > Mike > >> >> Emmitt Dove >> >> Manager, Converting Applications Development >> >> Evergreen Packaging, Inc. >> >> [email protected] >> >> (203) 214-5683 m >> >> (203) 643-8022 o >> >> (203) 643-8086 f >> >> [email protected] >> >> >> >> From: [email protected] [mailto:[email protected]] On Behalf Of MDRD >> Sent: Monday, April 26, 2010 17:46 >> To: RBASE-L Mailing List >> Subject: [RBASE-L] - RE: Strange problem? >> >> >> >> Hi Tony >> >> >> >> Thanks, I will check into that... I really think the error was between >> their >> ears! >> >> >> >> >> >> Marc >> >> >> >> >> >> >> >> From: A.G. IJntema <mailto:[email protected]> >> >> Sent: Monday, April 26, 2010 4:34 PM >> >> To: RBASE-L Mailing List <mailto:[email protected]> >> >> Subject: [RBASE-L] - RE: Strange problem? >> >> >> >> Hi, >> >> >> >> I have followed your discussion about the loss of data a little bit. >> >> Instead looking for a technical solution I have another suggestion. >> >> >> >> In all my applications I have a steering table which only contains just 1 >> row and it keeps track of important data. >> >> For instance: Some reports are financial relevant and they contain a >> sequence number which is incremented by one for every new report that is >> created. Accountants love it, because they are able to check if all the >> reports are there. Another thing you can do is add the report number to >> the row which is reported. In this case you are able to reconstruct a >> report >> afterwards and it can be proven that financial data have not been changed >> afterwards. Accountants love this feature even more as you can imagine. >> >> >> >> Another possibility is to keep track of the backup date and expand the >> database name with a sequence number of the backup. In this way you >> achieve >> two goals. First the backup database is not usable without renaming it. >> Secondly you always able to keep track if and when a backup has been >> made. >> >> >> >> Hope this view helps a little to tackle your problem. >> >> >> >> Regards >> >> >> >> Tony IJntema >> >> The Netherlands >> >> >> >> >> >> >> >> From: [email protected] [mailto:[email protected]] On Behalf Of MDRD >> Sent: maandag 26 april 2010 15:06 >> To: RBASE-L Mailing List >> Subject: [RBASE-L] - Strange problem? >> >> >> >> >> >> Friday I had the 2nd user this year call and say that Rbase lost a weeks >> worth of data. >> >> I am sure RBase had nothing to do with this and I explained that it is >> impossible for a weeks worth of data to get deleted >> >> without corrupting the data base. The user said there were no errors on >> Autochk. >> >> >> >> I told them it appears that somehow they connected to an older backup >> copy >> of the data. They said they were missing >> >> Customers, transactions, recap stats everything from X date on. >> >> >> >> I explained how PK's, FK's .... and such I would have to delete the data >> in >> reverse order such as I can not delete a customer >> >> until I deleted their transactions because the data is linked... >> >> >> >> The user seemed to understand but is there any way I can prevent this or >> make it easier to prove it was a staff error or computer >> >> error not an RBase error? >> >> >> >> Another strange problem, a user called and they had transactions in the >> Daily table for customer 0 which does not exist in the >> >> customer table, there are PK's and FK's on those tables. I told them I >> thought they had to have some kind of short on their network >> >> because we can't even enter a transaction for customer 0... so for it to >> get >> in there there was some kind of computer hiccup. >> >> >> >> The normal start up routine is to run Autochk, if it passes make a copy >> of >> the DB files called Bck, then Zip them up with the day of the >> >> weeks name on it such as Monday.zip. Strange thing is they swear they do >> this everyday yet some of those files were dated March 17. >> >> >> >> I am now going to add some code to check the date of those files and if >> they >> are too old give them a warning. >> >> >> >> Any suggestions? >> >> Marc >> >> >> >> >> >> >> >> > >

