This is a weird one, and I'm not expecting much of a response because I cannot really supply much in the way of information.

We have code in our application that relies on getting the logical name of the table, via "Get_Attribute DF_FILE_LOGICAL_NAME of hFile to sName". And in the main this is fine, and why wouldn't it be?

Except that from time to time we get error reports from clients that point to this returning a blank for whatever reason (but there's nothing apparently wrong with the filelist)

For example, in one section of code we have:

Code:
Get_Attribute DF_FILE_LOGICAL_NAME of iItemData to sProperty
Move (SFormat('p%1_In_Use',sProperty)) to sProperty
And this dynamically builds up a property name based on the table name. But sometimes we get error reports along the lines of:

Error : 54
Error Text : Invalid symbol in expression. GET_P_IN_USE
Database : live (Server=XXXXX Database=XXXXX) (0.0.0.0)
What's interesting here too is the 0.0.0.0 in the error report, because this would normally report the version number of the database. And the code that gets that? Well, that happens to also contain:

Code:
Get_Attribute DF_FILE_LOGICAL_NAME of hFile to sName
If (sName='') Begin
    Move '0.0.0.0' to sDbVersion
End

So both the error 54 AND the reported version of 0.0.0.0 are apparently as a result of the DF_FILE_LOGICAL_NAME returning a blank value.

If the user closes and re-opens the application the error goes away, so it's only a temporary, intermittent thing.

Can anyone think of a reason why "Get_Attribute DF_FILE_LOGICAL_NAME ..." would sometimes - but not always - return a blank string? It's all rather odd.


This is DataFlex 18.2 running against an MSSQL database.