Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
The oApp value sometimes does not log in
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01685542
Message ID:
01685550
Views:
31
Sorry, but I don't understand how I can compare:
conn_handle_access method vs conn_handle_source property

How can you compare method vs a property?

>Hi,
>
> this.conn_handle_source is zero or less than zero.
>Or you test another property; conn_handle_access method vs conn_handle_source property.
>
>MartinaJ
>
>>Hi,
>>
>>I am trying to figure out why a log file sometimes does not have a certain value.
>>
>>Here is an example:
>>In some programs (.prg), to check if the connection to SQL Server is valid, the code calls the application object property conn_handle. As this:
>>
>>oApp.conn_handle_source = 5 && or a different number depending on where the check is made)
>>=oApp.conn_handle
>>
>>
>>In the application class, when the call to oApp.conn_handle is made (via =oApp.conn_handle), the following method is fired: PROCEDURE conn_handle_access
>>This method (conn_handle_access) checks the connection. And if it is good, the following entry is logged:
>>
>>local cCalledFrom
>>cCalledFrom = "" 
>>IF this.conn_handle_source > 0
>>    cCalledFrom = " Called From " + ALLTRIM(STR(this.conn_handle_source))
>>ENDIF 
>>		
>>LOCAL ARRAY aStackArray[1,1]
>>ASTACKINFO(aStackArray)
>>cCalledFrom = CHR(13) + CHR(10) + SPACE(22) + cCalledFrom + " Program: " + aStackArray[alen(aStackArray,1)-1,2] + " Module: " + aStackArray[alen(aStackArray,1)-1,3]
>>
>>STRTOFILE( TTOC(DATETIME()) + " oApp.conn_handle_access(). " + cCalledFrom +  CHR(13) + CHR(10), cLogFilePath + cLogFileName, 1 )
>>
>>
>>
>>The problem is that sometime the .log file does not have the "Called From #" but only "Program:.... "
>>As if the value in property this.conn_handle_source is 0 (zero). But I check the code and a value (a number) is always assigned.
>>Why would the it not be in the log file?
>>Anybody see something wrong with the code above?
>>
>>TIA
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform