Maybe you could break it up into a little test program to narrow it down and ensure it's the Oracle connection causing the problem. Cut out all your code and do something like this:

AGETFILEVERSION("Your exe")

* test that correct values returned

* then connect to Oracle

* check AGETFILEVERSION()

* disconnect from Oracle

* check AGETFILEVERSION()

* then connect to Oracle

* check AGETFILEVERSION()

* disconnect from Oracle

* check AGETFILEVERSION()

FWIW I use NOT VERSION(2) = 0 to determine if I'm running in development mode (I almost never run the exe in development mode, just start from the main program or run the individual form). SYS(16,0) or PROGRAM(0) may also help you out as an alternative.


Frank.

Frank Cazabon

On 01/05/2018 03:23 PM, Paul H. Tarver wrote:
Frank,

Sorry for the delay in responding. Here's the basic code I'm using:

m.plFileDesc = "MAIN PROGRAM"

lnExeNumber = ADIR(laPrograms, '*.EXE')
=ASORT(laPrograms,3,-1,1)

leRetVal = ''

IF m.lnExeNumber > 0

        FOR lnLoopCnt = 1 TO m.lnExeNumber

                lnElements = AGETFILEVERSION(laVersInfo,
laPrograms[m.lnLoopCnt,1])

                IF m.lnElements > 0

                        IF UPPER(ALLTRIM(laVersInfo(3))) ==
ALLTRIM(m.plFileDesc)

                                leRetVal =
ALLTRIM(laPrograms[m.lnLoopCnt,1])
                                EXIT

                        ENDIF

                ENDIF

        ENDFOR

ENDIF

Here's the logical process:

1) Start Foxpro, run form, get connection handle to Oracle via ODBC and the
code above works perfectly.
2) Exit form (without closing Foxpro) and restart form and though we get a
valid array from ADIR() but AGETFILEVERSION() returns ''
3) Exit Foxpro, restart and GOTO back to step 1

The reason for this code is to identify the application .EXE. Perhaps there
is a better way to identify the application name that will eliminate the
need to use AGETFILEVERSION() to identify the main .exe file for the
application.

Paul

-----Original Message-----
From: ProfoxTech [mailto:profoxtech-boun...@leafe.com] On Behalf Of Frank
Cazabon
Sent: Sunday, April 29, 2018 4:26 PM
To: profoxt...@leafe.com
Subject: Re: AGETFILEVERSION Fail

Paul,

what's the code you are using?

Frank.

Frank Cazabon

On 28/04/2018 02:38 PM, Paul H. Tarver wrote:
Has anyone ever had any problem with AGETFILEVERSION() failing to return
values after an ODBC connection is made?

I'm using the Oracle ODBC Driver and until the SQLCONNECT() command is
issued AGETFILEVERSION() works perfectly. After I issue the SQLCONNECT()
command and get a valid handle, AGETFILEVERSION() will not return any
values. I have to exit VFP and restart it, then, AGETFILEVERSION() works
again until I make another connection to Oracle via ODBC.

I've used the Oracle's ODBC driver previously with no ill affect. But
now.Grrrrrr!

Paul



--- StripMime Report -- processed MIME parts ---
multipart/alternative
    text/plain (text body -- kept)
    text/html
---

[excessive quoting removed by server]

_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/9e29f7f8-10c5-40f9-c8a4-c76df7360...@gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to