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:
01685544
Views:
46
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
"Navision is evil that needs to be erazed... to the ground"

Jabber: gorila@dione.zcu.cz
Jabber? Jabbim
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform