Path too long, Foxpro app fails

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?
 
D

David H. Lipman

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?
 
P

Plato

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.
 
C

Cindy Winegarden

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top