Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Mysterious disappearing, tableupdated data
Message
From
19/07/2004 12:55:13
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Mysterious disappearing, tableupdated data
Miscellaneous
Thread ID:
00925823
Message ID:
00925823
Views:
47
Dear Foxperts

I'm appending loads of records to a table (data agragated and copied from one table to the other), I watch them being created, in debug, I Tableupdate(.T.) regularly and appropriately. All done, the form is released, Autoclosetables in .T.

I go to look at the table and ... not a sausage. Weird thing is, this has always worked before but now it's not. Equally, the source table gets its field names and captions from an Excel S/s (via DBSETPROP()), and these capts. (very important because the field names, representing census categories, are meaningless without the s/s caption) used to be copied from source to dest. Now this not working.

I include the code below for clarification. The only difference nowadays is that the data aren't in a fixed place, but are found by means of a path string. So the data are in a different place from when the system worked ok.

It's interesting that, although I run the "Change database" code in the .BeforeOpenTables() of the DE, in debug the dbc() func returns the tables' original dbc and not the onme taht accompanies them in the remote folder.

Any help?

Frustrated of England
Wait WINDOW "Populating CENSUS ZONE Table from Census ED Data..." NOWAIT NOCLEAR
*________________
Select CENEDZONE											&& Census ED - Zone link table
SCAN
  lnRecNo			= lnRecNo + 1
  lcED_Area_ID		= ED_AREA_ID
  lnPercAlloc		= PERC_ALLOC
  If CENEDZONE.ZONE <> lnZoneNo	    && Finished totting for last zone no
      Select CENSUSZN
      If not INDEXSEEK( lnZoneNo)  && If not already got 
	  Append BLANK in CENSUSZN	&& Create new Census Zone rec
      EndIf not SEEK()
      Replace ZONE 	with lnZoneNo		in CENSUSZN
      Replace VAR_ID	with Thisform.nVarID	in CENSUSZN	
      FOR lnFieldNo = 3 to lnFieldCount		&& For all fields in CENSUSZN rec, bar ZONE, VAR_ID
	lcFieldName	= ALLTRIM( FIELD( lnFieldNo))

*	Round result to correct integer no. of people in each category
*	______________________________________________________________
	Replace &lcFieldName with INT( ROUND( laFieldTots( lnFieldNo-2), 0)) in CENSUSZN
      ENDFOR
      = TABLEUPDATE(.T.)
      laFieldTots	= 0  	  		&& Clear array for next rec
      lnZoneNo		= CENEDZONE.ZONE	&& next new zone no
  EndIf CENEDZONE.ZONE <> lnZoneNo
  
  If SEEK( lcED_Area_ID, "CENSUSED", "ED_AREA_ID")	&& if find parent ED in CENSUSED
      Select CENSUSED
      FOR lnFieldNo = 3 to lnFieldCount	&& For all fields in CENSUSED rec, bar ED_AREA_ID & PERC_ALLOC
	lcFieldName	             = ALLTRIM( FIELD( lnFieldNo))    
	laFieldTots( lnFieldNo-2)  = laFieldTots( lnFieldNo-2) + &lcFieldName * lnPercAlloc / 100
      ENDFOR
  EndIf SEEK()
  Select CENEDZONE
ENDSCAN

Select CENSUSZN		&& Last rec after loop
If not SEEK( lnZoneNo)	&& If not already got 
    Append BLANK 	in CENSUSZN	&& Create LAST Census Zone rec
EndIf not SEEK()
Replace ZONE with lnZoneNo			in CENSUSZN
Replace VAR_ID	with Thisform.nVarID	in CENSUSZN	
FOR lnFieldNo = 3 to lnFieldCount	&& For all fields in CENSUSZN rec, bar ZONE, VAR_ID 
  lcFieldName	= ALLTRIM( FIELD( lnFieldNo))
  Replace &lcFieldName with INT( ROUND( laFieldTots( lnFieldNo-2), 0)) in CENSUSZN
ENDFOR
 = TABLEUPDATE(.T.)
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.
Next
Reply
Map
View

Click here to load this message in the networking platform