Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ALTER TABLE error: file c:\temp\0502743.tmp does not exi
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00542442
Message ID:
00542456
Vues:
17
This message has been marked as a message which has helped to the initial question of the thread.
>I have found that alter table command
>causes error:
>
>File c:\temp\0502743.tmp does not exist
>
>My program runs on NT 4.0 server and VFP 5 build 415 runtime.
>c:\temp is NT temporary files catalog. Workstations can use dbf files in server normally using same common exe file located in server.
>I can create and edit files in this temporary directory.
>Program works about year normally. Suddenly it starts to produce this error. This error occurs always when I try to open form. Other commands which create files in temporary directory work OK.
>Why?
>
>Code causing error is:
>
>
>select myTable
>local lStru
>dime lstru[1]
>afields( lStru )
>crs = 'rid_'
>create cursor (crs) from array lStru
>* Next line causes error
>* file c:\temp\0502743.tmp does not exist. Why ?
>alter table (crs) add column myColumn L
>
Andrus,

I've encountered this before, and in my case, it only seemed to happen when using ALTER TABLE with a cursor. It didn't happen in all environments for me, so I concluded it was memory related, probably having to do with the cursor residing in memory and never really being written to the disk (just my guess).

I worked around it by creating a function to add a field to a cursor. Something like (needs more error checking):
PROCEDURE AddFieldtoCursor

*    Add a field to a cursor
*    =======================

LPARAMETER Xcursor, Xfld, Xtype, Xsize, Xdec
PRIVATE Xarr

Select (Xcursor)
=AFIELDS(Xarr)
DIMENSION Xarr[ALEN(Xarr,1)+1,ALEN(Xarr,2)]
Xarr[ALEN(Xarr,1),1]=Xfld
Xarr[ALEN(Xarr,1),2]=Xtype
Xarr[ALEN(Xarr,1),3]=Xsize
Xarr[ALEN(Xarr,1),4]=Xdec
Xarr[ALEN(Xarr,1),7]=""
Xarr[ALEN(Xarr,1),8]=""
Xarr[ALEN(Xarr,1),9]=""
CREATE CURSOR &Xcursor FROM ARRAY Xarr
RELEASE Xarr
RETURN
ENDPROC
HTH,
Scott
Scott King
The Support Source Corporation
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform