Time-source and database connection

sdjensen

Member
In my logs I have seen "** Database /database/sports2000 not connected. (1021)" for some time now without finding the problem.
The problem was in my write trigger and the records was updated without problems. The database logs did not show anything unusual.

Quiz - find the error :D
Code:
session:time-source='sports2000'.
message '1' session:time-source.
def var SavTimeSrc as char no-undo.
assign
  SavTimeSrc=session:time-source  /* Date Time always from server */
  session:time-source='sports2000'.
message '2' session:time-source.
message '2.5' SavTimeSrc.
session:time-source=SavTimeSrc.
message '3' session:time-source.

The error only exists if one connect to database with the path like
Code:
connect /database/sports2000.
Between 2.5 and 3 the error will occur because the variable SavTimeSrc will contain the complete database name incl path and time-source should only be set to the database name.

There is no problem if the database is connected through -H / -S.
 

KrisM

Member
I think the problem lies with progress.
When you assign the session:time-source, you must assign a logical database name to it.
After the assignment though it will contain the physical database name.
So solution is to make sure your SavTimeSrc always contains the logical database name, not the physical database name.
 
Top