Mike,
I'd also give the line:
llOK = this.ExecuteSQL(lcSQL) = 1

a look as I think the this could cause you problems if the ExecuteSQL is 
returning back a boolean value

Personally, even though I use it occasionally I am not a fan of in line 
assignments and would split it up into two separate assignments.

In fact VFP seems to return weird results when comparing Boolean values to 
integer values, Try the following:

ncount=9
? ">",(ncount=9),">"

And then

ncount=.T.
? ">",(ncount=9),">"

Look at the output .... the second "?" returns back nothing after the initial 
"<"

Dave


-----Original Message-----
From: ProFox [mailto:profox-boun...@leafe.com] On Behalf Of 
mbsoftwaresoluti...@mbsoftwaresolutions.com
Sent: 11 August 2015 04:21
To: ProFox Email List <profox@leafe.com>
Subject: RE: VFP9SP2 pop-up box for nearly everything

Well, I should confess that it's some bug in this code of mine, although I've 
retooled this to totally eliminate the DBF file and just go right to my backend 
(MySQL).  This was the old code.  No doubt I had something assumed/wrong with 
my DBF table:

FUNCTION Audit(tcFormName as String, tcUniqueID as String, tlEntering as 
Logical, tcUserID as String, tcSessionID as String) as Logical
* Audits form usage.
*** mjb 05/15/2014 - using local audit table so no remote database connection 
needed at startup; will be
*** mjb 01/07/2015 - using PRIVATE vars in INSERT cmd
*** mjb 07/29/2015 - changed local name to match for client
        LOCAL llOK as Logical, lcSQL as String, loException as Exception, 
lcLocal as String, liHandle as Integer
        PRIVATE pcUserID, pcModule, pcUniqueID, pcSessionID
        TRY
                liHandle = this.GetHandle() && mjb 07-29-15
                lcLocal = ADDBS(JUSTPATH(this.cAuditDBF)) + 
this.GetTableName('audit') 
+ ".dbf"
                IF NOT FILE(lcLocal) THEN
                        CREATE TABLE (lcLocal) (user c(16), module c(30), 
uniqueid c(10), sessionid c(10), entering l, uploaded l, tlocal t)
                ENDIF
                USE IN (SELECT(JUSTSTEM(lcLocal))) && make sure not exclusive

                IF VARTYPE(tcUserID) = "C" AND NOT EMPTY(tcUserID) THEN
                        pcUserID = tcUserID
                ELSE
                        *** mjb 07/29/2015 - adjusted for startup call from 
main where oUtils.oUser not yet existing
                        IF TYPE("oUtils.oUser") = "O" THEN
                                pcUserID = ALLTRIM(oUtils.oUser.cID)
                        ELSE
                                pcUserID = SYS(0)
                        ENDIF
                ENDIF && VARTYPE(tcUserID) = "C" AND NOT EMPTY(tcUserID)
                IF PEMSTATUS(_screen,"cUniqueID",5) THEN
                        pcSessionID = _screen.cUniqueID
                ELSE
                        pcSessionID = 'unknown'
                ENDIF
                ltLocal = DATETIME()
                IF VARTYPE(tcUniqueID) = "C" AND NOT EMPTY(tcUniqueID) THEN
                        pcUniqueID = tcUniqueID
                ELSE
                        pcUniqueID = ''
                ENDIF && VARTYPE(tcUniqueID) = "C" AND NOT EMPTY(tcUniqueID)

                INSERT INTO (this.cAuditDBF) (user, module, uniqueid, 
sessionid, entering, tlocal) ;
                        VALUES (pcUserID, ALLTRIM(tcFormName), pcUniqueID, 
pcSessionID, tlEntering, ltLocal)

                IF liHandle > 0 THEN
                        lcTable = this.GetTableName('audit')
                        TEXT TO lcSQL PRETEXT 15 NOSHOW TEXTMERGE
                                INSERT INTO <<lcTable>> (user, module, 
uniqueid, sessionid, entering, tlocal)
                                VALUES
(?pcUserID,'<<ALLTRIM(tcFormName)>>',?pcUniqueID,?pcSessionID,<<IIF(tlEntering,1,0)>>,'<<TTOC(ltLocal,1)>>')
                        ENDTEXT
                        llOK = this.ExecuteSQL(lcSQL) = 1
                        IF llOK THEN
                                REPLACE uploaded WITH .T. IN 
(JUSTSTEM(this.cAuditDBF))
                        ELSE
                                SET STEP ON
                        ENDIF && llOK
                ENDIF
        CATCH TO loException
                llOK = .F.
                *SET STEP ON
        ENDTRY
        RETURN llOK
ENDFUNC && Audit(tcFormName as String, tcUniqueID as String, tlEntering as 
Logical, tcUserID as String, tcSessionID as String) as Logical


Thanks again to all of you who chimed in!

[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/18725b8cd2d5d247873a2baf401d4ab2598c7...@ex2010-a-fpl.fpl.LOCAL
** 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