At 06:52 AM 2/19/2010, A.G. IJntema wrote:
Lately I sometimes encounter problems when I try to open a
database, which has an owner password, by the application.
When I start the application from windows the owner name
is asked by the application, though this one is mentioned
in the application itself.
Tony,
To find out if the owner name is retained when starting the
application, type the following at the R> prompt and see
what you get:
SHOW USER
Notice the string like: "The current user id is:"
If that is the correct owner name, you should be able to
start the application.
If not, you may need to take a closer look at the specific
routine that starts the application.
Has anyone the same experience and even better a solution
for it.
Here is a routine that you can use to automate the process
of CONNECTing the database in a network environment with
SET STATICDB ON, SET FASTLOCK ON, and SET QUALCOLS 2.
-- Start here ..
-- MyApp.DAT Startup Application File
-- Start Fresh
CLEAR ALL VARIABLES
LABEL StartFresh
DISCONNECT
SET QUOTES=NULL
SET QUOTES='
SET DELIMIT=NULL
SET DELIMIT=','
SET LINEEND=NULL
SET LINEEND='^'
SET SEMI=NULL
SET SEMI=';'
SET PLUS=NULL
SET PLUS='+'
SET SINGLE=NULL
SET SINGLE='_'
SET MANY=NULL
SET MANY='%'
SET IDQUOTES=NULL
SET IDQUOTES='`'
SET CURRENCY '$' PREF 2 B
DISCONNECT
SET STATICDB OFF
SET ROWLOCKS ON
SET FASTLOCK OFF
SET TIMEOUT 120
SET FEEDBACK OFF
LABEL Start
DISCONNECT
SET STATICDB ON
SET FASTLOCK ON
SET QUALCOLS 2
SET MESSAGES OFF
SET ERROR MESSAGES OFF
SET ERROR MESSAGE 2495 OFF
CONNECT dbname IDENTIFIED BY ownername
SET ERROR MESSAGE 2495 ON
SET MESSAGES ON
SET ERROR MESSAGES ON
-- Check the availability of database
IF SQLCODE = -7 THEN
CLS
PAUSE 2 USING 'Unable to Connect the Database.' +
CAPTION ' Your Application Caption Here ...' +
ICON STOP +
BUTTON 'Press any key to continue ...' +
OPTION MESSAGE_FONT_NAME Verdana +
|MESSAGE_FONT_COLOR RED +
|MESSAGE_FONT_SIZE 10 +
|MESSAGE_FONT_BOLD 'TRUE' +
|BUTTON_COLOR WHITE +
|BUTTON_FONT_COLOR GREEN +
|THEMENAME R:BASE Rocks!
CLOSEWINDOW
EXIT
ENDIF
-- Enforce Default Settings
SET QUOTES='
SET DELIMIT=','
SET LINEEND='^'
SET SEMI=';'
SET PLUS='+'
SET SINGLE='_'
SET MANY='%'
SET IDQUOTES='`'
SET CURRENCY '$' PREF 2 B
SET NULL ' '
SET DATE FORMAT MM/DD/YYYY
SET DATE SEQUENCE MMDDYY
SET DATE YEAR 30
SET DATE CENTURY 19
CLS
EDIT USING ApplicationMainMenu
RETURN
-- End here ...
Notes:
01. Correct the appropriate lines accordingly if you wish
to use STATICDB, FASTLOCK, and QUALCOLS settings.
02. Verify the CHARacter SETtings related to your database.
03. Verify the DATE and TIME settings related to your database.
04. Re-visit the routine that closes the application to either
EXIT or go back to the Database Explorer or R> prompt.
05. Create yourself a startup file with SET STATICDB OFF
prior to CONNecting the database when you are in a
"development mode" and making structural changes, when
no one else is connected to the same database.
DISCONNECT
SET STATICDB OFF
CONNECT dbname IDENTIFIED BY ownername
RETURN
Have fun!
Very Best R:egards,
Razzak.