At 05:03 PM 5/21/2010, jan johansen wrote:
Ed,
The beauty of an external form is that it doesn't need to be connected
to the database. So it is possible that you weren't really connected
to the database during your call. And that would explain why it worked
from the prompt but not from the menu.
Just supposing out loud.
In that specific scenario, use the following code as "On After Start EEP"
to assure the establishment of a required CONNection before performing DB
related task(s) in R:BASE External Form File (.rff).
-- Start here ...
-- External Form - On After Start EEP
IF (CVAL('DATABASE')) <> 'dbname' OR (CVAL('DATABASE')) IS NULL THEN
SET ERROR MESSAGES OFF
CONNECT dbname IDENTIFIED BY owner password
SET ERROR MESSAGES ON
ENDIF
-- Check the availability of database (if required)
IF SQLCODE = -7 THEN
SET VAR vPause2Message = +
('Database is temporarily unavailable. Please try again later.')
CLS
PAUSE 2 USING .vPause2Message +
CAPTION ' Your Company Name: Your Application Title Here ...' +
ICON STOP +
BUTTON 'Press any key to continue ...' +
OPTION MESSAGE_FONT_NAME Tahoma +
|MESSAGE_FONT_COLOR RED +
|MESSAGE_FONT_SIZE 11 +
|BUTTON_COLOR WHITE +
|BUTTON_FONT_COLOR GREEN +
|THEMENAME R:BASE Rocks!
CLOSEWINDOW
EXIT
ENDIF
CLEAR VARIABLE vPause2Message
RETURN
-- End here ...
Note:
Update "dbname" with your database name before implementing this code
into your eternal form as "On After Start EEP".
Have fun!
Very Best R:egards,
Razzak.