Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Invalid path while trying to network application

Status
Not open for further replies.

jhed

Programmer
Apr 21, 2014
33
PH
i have this application that is used through network. i just shared the application folder and set the permission to everyone. My forms and tables has no problem on accessing through the network but i have this encryp.prg (program) that i always used whenever i create new user. When i triggered the command on the network, not on the server or the computer where i place the original copy of my app folder, the error says "Invalid path". but on the computer where my original folder located there's no error coz it is set to the default drive c.
I tried to used the set default and set path but they wont solved the problem. i also tried to map the folder to drive c where c is the default drive of my application in my original app folder but no luck. i worked my program in drive c so the path will be "C:\foldername" when i map the folder, the path is "C:\" it will not take the folder name. so it will display the error when i run through network. Sorry for the few solution that i mentioned i am not able to think a better idea to solved this.
 
sorry for the late reply, the syntax contains procedure only.
 
What is encrypt.prg using? Is there some component, which could look for a key file at a certain location and not find it? I don't think you get this error because VFP doen't find something, that wouldn't prompt "Invalid path".

If you DO c:\hdjksfhsdkh\sdkjfhdsjkh.prg the error message is: File 'sdkjfhdsjkh.prg' does not exist
If you Set Procedure To c:\hdjksfhsdkh\sdkjfhdsjkh.prg ADDITIVE the error message is: File 'sdkjfhdsjkh.prg' does not exist

In fact if you look into the help topics "Error Messages Listed Alphabetically" or "... Numerically" there is no VFP error message containing "invalid path", that comes from sommewhere else. Most probably from encrypt.prg or from a DLL used by encrypt.prg

Bye, Olaf.
 
Wrong, there is error 202, but then you have to have something unallowed eg

Set Procedure To c::\some.prg is causing the "invalid path" error, because a path can't have a double colon. Really something in the path given is invalid.

Bye, Olaf.

 
i tried the do encrypt.prg and do do C:\foldername\encrypt.prg the same error occur. tried also plasing and removing the set path the same error. note the error occur only on the other computer where i network my application folder.

here's the syntax in my prog,
FUNCTION enCrypt
PARAMETER val1, val2
reTurn '' + BITXOR(0h+val1,LEFT(0h+val2, LEN(val1)))
 
You have to SET PROCEDURE to be able to use a function within a prg.
And why is this a seperate prg anyway? Compile it into the EXE and you have no problem at all.

Bye, Olaf.
 
how about this sir olaf, how can i place the set procedure if i have this statement:
- thisform.text1.value = encrypt(thisform.text1.Value,thisform.text2.Value)
where the encrypt is my prg, value of text1 is user input and value of text 2 is auto generated.
 
A SET PROCEDURE statement is used to make a PRG file known, before first using it. The same goes for class definitions in VCXes or PRGs via SET CLASSLIB. So such statements are put into the starting code, main.prg or into the init of a goApp application object. Anywhere before making use of encrypt().

Bye, Olaf.
 
But again: You don't need any SET PATH, SET PROCEDURE, SET CLASSLIB for anything inside an EXE, as VFP searches inside the currently running EXE anyway. So having a problem with a path points out this prg is excluded from compilation into the EXE and therefore not found or even searched along invalid paths.

Bye, Olaf.
 
i tried the do encrypt.prg and do do C:\foldername\encrypt.prg the same error occur.

This tells me the error is likely coming from inside encrypt.prg, not from trying to find encrypt.prg.

You need to use the debugger to trace through the code and find out exactly where the problem exists.

Further,

Code:
FUNCTION enCrypt
PARAMETER val1, val2
reTurn '' + BITXOR(0h+val1,LEFT(0h+val2, LEN(val1)))

1. If you have this code (and only this code) in a program file named encrypt.prg, then you do not need the FUNCTION statement, and in fact it will hinder performance.
2. Why is there an empty string at the start of the return value?
3. This should not throw an 'invalid path' error UNLESS you're using a version of VFP that did not have the BITXOR() function and VFP is looking along the search path but you've got an invalid path on the search path.
 
Dan might have sppotted something as his remark no 3.

In regard to his remark 1 that's true if the encrypt.prg does not contain anything more than the encrypt function. In regard to 2, Dan, adding something to '' is a simple conversion from binary to char, eg: ? ''+0h414243 vs ? 0h414243

In the end there has to be some invalid path, not some non existing path. You can have your sourcecode on S:\sources\myvfpprojects\.., and later on execute the EXE on a PC without drive S, that's not a problem at all.

Bye, Olaf.



 
You can have your sourcecode on S:\sources\myvfpprojects\.., and later on execute the EXE on a PC without drive S, that's not a problem at all.

There's a caveat to that, depending on the version.

In earlier versions (although I think this was fixed in VFP6?), if your source was on (for example) D: and the machine running the EXE had a empty CD-ROM drive on D: there would be errors. The error wasn't that VFP couldn't find files, it's that the OS returned errors while trying to read it because it was empty.

The fix, at least temporarily, was to put in a disc. <g>
 
Hi Dan,

I was a victim of that VFP6 behaviour, too. But it only was for removable drives without an inserted medium. If you had a drive S: during development and there wasn't such a drive at runtime at all, that was no problem with VFP6, too. Invalid path really means something different than not found path or not existing drive. A path only is invalid, if there is an invalid character inside it, eg Unicode, or the composition itself is wrong. Windows is gracefully accepting multiple backslashes or slashes instead of backslashes, but no double colon :):) or other unallowed characters like ? or *.

I faintly remember there was a problem with wrong paths in the Windows environment variable %PATH%, though that is not used to find prgs, it wouldn't hurt to inspect it for wrong paths, even just non existant paths, for that matter.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top