Progress
Programming
Handbook
Positioning Database References in an Application
If possible, isolate database references within your application to help minimize the effects of a database connection failure on your application. This allows you to use the CONNECTED function effectively to test for a particular database connection, prior to passing program control to a subprocedure that accesses that database.
p-mainproc.pdb1proc.pdb2proc.pFigure 9–9: Positioning Database References
![]()
Figure 9–9 shows a main procedure that connects two databases and runs subprocedures, depending on whether or not a database is connected. If the CONNECT statement in
mainproc.p
fails to connect db2, onlydb2proc.p
subprocedure is effected by the database connection failure. This technique is useful for applications that run subprocedures from a menu.Do not reference a database in your application startup procedure, except possibly to connect it. Remember, you cannot connect to a database and reference a database in the same procedure. If you reference a database on an auto-connect list within the startup procedure of your application and the auto-connect fails for that database, the startup procedure does not run.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |