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

File does not exist 3

Status
Not open for further replies.

jimstarr

Programmer
Feb 6, 2001
975
US
I have the following code:

SELECT tskhist
=AFIELDS(tskarray)
GO TOP
CREATE CURSOR tskcursor FROM ARRAY tskarray
SELECT tskcursor
APPEND FROM tskhist FOR NOT DELETED()


I'm getting error #1 "File tskhist does not exist" on the APPEND FROM statement. I can't figure out how this can happen. Any ideas? Thanks!!

Jim
 
You don't say how tskhist is created. I assum it's a cursor. A cursor may or may not exist on disk. If it does, the filename is gibbish and generated by VFP. It is not names the same as the cursor alias (tskcursor)

Try this:

APPEND FROM (DBF("tskhist")) FOR !DELETED()

Craig Berntson
MCSD, Visual FoxPro MVP,
 
Jim,

Is TsKHist a cursor or a physical file?

You can't do an APPEND FROM a cursor. You can append into a cursor, but the source file has to be a physical DBF.

One solution would be to do it like this:

Code:
APPEND FROM DBF("TskHist")

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Tskhist is a physical dbf, not a cursor. -Jim
 
Jim, is it possible that TskHist is not in the VFP search path?

I know that the file is already open as a table, but I'm not sure if that matters when you do the APPEND FROM. If, when you opened the table, you specified an explicit path, the APPEND FROM might still be unable to find it. That could also happen if the search path (or default directory) changed for any reason.

You can confirm, or eliminate, this possiblity by testing for FILE("TskHist") immediately before the APPEND FROM.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
APPEND FROM DBF('tskhist') does the job. Thanks, guys!


Jim
 
Jim,
That all could be done with:
Code:
SELECT *;
       FROM tskhist;
WHERE NOT DELETED();
INTO CURSOR Tskcursor READWRITE

Borislav Borissov
VFP9 SP2, SQL Server 2000/2005.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top