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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"'field' phrase cannot be found " ERROR

Status
Not open for further replies.

ron108

Programmer
Jun 19, 2002
14
US
I am running this code on 8 work stations. It runs ok on 5 of them but the other 3 get a "'field' phrase cannot be found" error message at the ****** point indicated below.

The code is in a form activate event.

2 of the machines are on 98 the other is on XP

---------------------------------------------------------
LOCAL lcwinnt
THIS.defaultold = SYS(5) + SYS(2003) && current directory and drive

*/ to make sure this works on both 95/98/2000/NT/XP
SET SAFETY OFF
DO CASE
CASE OS() == "Windows NT 5.00"
lcwinnt = "winnt"
OTHERWISE
lcwinnt = "windows"
ENDCASE


DO CASE
CASE lcwinnt = "winnt"
SELECT DISTINCT allsdate FROM allsscr INTO ;
TABLE c:\winnt\temp\allsdate ORDER BY allsdate

SELECT DISTINCT program,action FROM allsscr INTO ;
TABLE c:\winnt\temp\allscamp ORDER BY program

CASE lcwinnt = "windows"
SELECT DISTINCT allsdate AS allsdate2 FROM allsscr INTO ;
TABLE c:\windows\temp\allsdate ORDER BY allsdate

SELECT DISTINCT program,action FROM allsscr INTO ;
TABLE c:\windows\temp\allscamp ORDER BY program
ENDCASE

SELECT allsdate


******** error message occurs here ***********
THISFORM.cbodate.SETFOCUS
-----------------------------------------------------------
 
Ron,
I believe you are making a bad assumption about the name of the system directory. (I have a Win98 system that uses c:\win98\ and an upgraded XP system - CASE OS() == "Windows NT 5.01" - that uses c:\winXP\ !) You might want to use one of the following three options:

lcWinDir = GETENV("WINDIR")

Declare Integer GetWindowsDirectory In Win32API String @, Integer
lcData = Space(100)
lnData = 100
lnLen = GetWindowsDirectory(@lcData, lnData)
lcWinDir = Substr(lcData,1,lnLen)

#DEFINE WindowsFolder 0
oFS = CREATEOBJECT('Scripting.FileSystemObject')
lcWinDir = oFS.GetSpecialFolder(WindowsFolder).Path

Rick
 
the error indicates that the data is not there. rgbean has a valid point that could be the cause of the data not being there.
My question, is this happening when the forma first loads only or any time you switch back to the form after form loosing focus? I say this, because, unless you are using the data environment to create tables, views, then you should be using the load to create them. the activate event fires after the form controls are instanciated, which means that the textbox has no data.
Attitude is Everything
 
thanx rgbean and danceman

The GETENV("WINDIR") gave me what I needed.

The problem did occur when the form first loaded.

The function gives me the directory name I needed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top