Hi Guys,
I need some little help here
I put this code, to find open files and be able to close those files by the user who suppose to run the Exe application but i compliled, created the exe file and it does not run as it does in my computer, would like to know if you can help me here to figure out, what is wrong, the error message i get when i run it from his(user computer, by the way is a windows 7 pro 64bit) " no fields found to process", forgot to say i did this on VFP 9.0 SP1, My OS is Win xp pro 32 bit.
code at the main.prg in the project is as follow
in the form load i have this
in a command buttom to execute the code i have this.
note: the "SET DEFA TO S:\PRO50", it is a share folder in the server where the user has full access and in there are all the tables that will need to be close if needed.
so actually when i press the command button to execute the code in there, i got the error "" no fields found to process"
it is like the load vent in the form, does not create the cursor in the user computer which, that cursor, should be created in the S:\PRO50 FOLDER. the exe file resides in his c:\closefiles folder, including all the libraries DLL files needed.
any help very appreciated
Thanks a lot
I need some little help here
I put this code, to find open files and be able to close those files by the user who suppose to run the Exe application but i compliled, created the exe file and it does not run as it does in my computer, would like to know if you can help me here to figure out, what is wrong, the error message i get when i run it from his(user computer, by the way is a windows 7 pro 64bit) " no fields found to process", forgot to say i did this on VFP 9.0 SP1, My OS is Win xp pro 32 bit.
code at the main.prg in the project is as follow
Code:
Declare Integer ShellExecute In shell32.dll ;
INTEGER hndWin, ;
STRING cAction, ;
STRING cFileName, ;
STRING cParams, ;
STRING cDir, ;
INTEGER nShowWin
Set talk off
SET SYSMENU OFF
set sysmenu to
SET SAFETY OFF
set century on
SET EXACT on
SET CPDIALOG OFF
Set Talk Off
Set Confirm Off
Set Century On
Set Echo Off
Set Date AMERICAN
Set Console Off
Set Safety Off
SET EXCLUSIVE OFF
Set Deleted On
Set Autoincerror Off
Set Status Bar On
Set Exact On
LOCAL lcAppFolder
lcAppFolder = Addbs(Justpath(Sys(16,0)))
SET DEFAULT TO (m.lcAppFolder)
DO FORM ADDBS(m.lcAppFolder)+'\closefiles'
READ EVENTS
in the form load i have this
Code:
CREATE CURSOR junkopen (xID I, xuser c(10), xsystem c(10), xfiles c(100), xClose L)
INDEX on xuser+xfiles TAG xfiles
in a command buttom to execute the code i have this.
note: the "SET DEFA TO S:\PRO50", it is a share folder in the server where the user has full access and in there are all the tables that will need to be close if needed.
Code:
SET DEFAULT TO S:\pro50LOCAL oShell as wscript.shell, lcTempFile
lcTempFile = ADDBS(GETENV("TMP"))+SYS(3)+".txt"
oShell = createobject("WScript.Shell")
thisform.CoThrobber.Visible=.T.
* create a CSV list of open files in server
oshell.Run("cmd /c openfiles /query /S apexsrv1 /U chrisba /FO CSV /NH > "+m.lcTempFile,2,.T.)
* Clean it up, remove those warnings above the list
STRTOFILE(STREXTRACT(FILETOSTR(m.lcTempFile),"again.."),(m.lcTempFile))
* add records to our cursor
APPEND FROM (m.lcTempfile) TYPE CSV
* replace this later for selective closing
REPLACE xclose WITH .F. ALL
* Clean it up
SELECT * FROM junkopen WHERE INLIST(UPPER(JUSTEXT(xfiles)),"DBF","CDX","FPT") AND;
!EMPTY(JUSTEXT(xfiles)) INTO CURSOR junkopen2 NOFILTER
SELECT junkopen
ZAP
APPEND FROM DBF('junkopen2')
USE IN SELECT('junkopen2')
GO TOP
thisform.grid1.Refresh
thisform.CoThrobber.Visible=.F.
so actually when i press the command button to execute the code in there, i got the error "" no fields found to process"
it is like the load vent in the form, does not create the cursor in the user computer which, that cursor, should be created in the S:\PRO50 FOLDER. the exe file resides in his c:\closefiles folder, including all the libraries DLL files needed.
any help very appreciated
Thanks a lot