Path too long, Foxpro app fails

  • Thread starter Thread starter Todd
  • Start date Start date
T

Todd

When my system environment variable path is too long
(over 260 characters) my Foxpro application gets "Error
202 - Invalid path or filename". If I shorten the path
the Foxpro app works ok. Anyway to fix this?
 
Two suggestions:

Don't use long files names such as...

c:\program files\

use 8.3 convention such as...

c:\progra~1

Another method is to use the SUBST.EXE (substitute) command to create a drive letter for a
long patch such as...

subst g: "C:\Program Files\Common Files\Network Associates\VirusScan Engine\4.0.xx"

Then use G: in the path.

You can the place the SUBST command in the following Registry location...

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

Dave



| When my system environment variable path is too long
| (over 260 characters) my Foxpro application gets "Error
| 202 - Invalid path or filename". If I shorten the path
| the Foxpro app works ok. Anyway to fix this?
 
Todd said:
When my system environment variable path is too long
(over 260 characters) my Foxpro application gets "Error
202 - Invalid path or filename". If I shorten the path
the Foxpro app works ok. Anyway to fix this?

Sheesh, no need to have such long directory or filenames. Shorten them
to something reasonable.
 
In [email protected],
Todd said:
When my system environment variable path is too long
(over 260 characters) my Foxpro application gets "Error
202 - Invalid path or filename". If I shorten the path
the Foxpro app works ok. Anyway to fix this?

Hi Todd,

FoxPro has a maximum length of a quoted string of 255 characters - that
means the length of the characters between quotation marks. This issue can
be circumvented by concatening shorter strings such as:

cFileName = ;
"C:\My Documents\" + ;
"Visual FoxPro Projects\" + ;
"Test.dbf"
USE (cFileName)

Another way is something like:

cRoot = "C:\"
cPath = "My Documents\"
cDirectory = "Visual FoxPro Projects\"
cFileName = "Test.dbf"
USE (cRoot + cPath + cDirectory + cFileName)
 
Back
Top