Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Corrupt table observations
Message
De
15/04/2003 12:02:33
 
 
À
15/04/2003 10:06:14
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00777421
Message ID:
00777832
Vues:
9
>Since you mention up to 13 users can I assume that you are NOT using Win >peer-to-peer for the network? And if that is correct, what network OS and >SP level are you using?

NT4 SP5 or 6? Switches & all 100bt NICS.

I normally dont do a tableupdate, unless problems occur, like cant access table.

Here is some code that includes one of those automated processes: the table that was corrupted was punchparams.dbf. SO this code runs, besides being updated manually, through a form.
close tables all
use 'i:\data\ecnc\data\punchheader.dbf' in 1 shared
use 'i:\data\ecnc\data\dwgdata.dbf' in 2 shared
use 'i:\data\ecnc\data\punchparams.dbf' in 3 shared
set deleted on
set exact on

* search punchheader.dbf and add jobnum, numofparts and drawingnum to punchparams.dbf 
* if it doesn't exist, if numofparts>1, if length of jobnum>0
local lcJob, lnParts, llFound, lnDwgNum
select 1
scan 
	lcJob=alltrim(punchheader.jobnum) 
	lnParts=(punchheader.numofparts)
	lnDwgNum=val(alltrim(punchheader.drawingnum))
	select 3
	go top
	llFound=(.F.)
	scan for (alltrim(punchparams.jobnum))=(lcJob)	
		llFound=(.T.)
	endscan
	if llFound=(.F.) and (lnParts)>=1 and len(lcJob)>0
		append blank
		replace punchparams.jobnum with (lcJob)
		replace punchparams.numofparts with (lnParts)
		replace punchparams.drawingnum with (lnDwgNum)
		** set the head concentricity to 0.003 by default doesnt get updated by the drawing yet
		replace punchparams.hc WITH 0.0030
	endif		
endscan

* replace all drawing info in params with that from dwgdata.dbf
* if drawing exists in params
set exact on
set deleted on
select 2
go top
scan 
	scatter memvar
	m.drawingnum=val(alltrim(dwgdata.drawingnum))
	m.ol=m.pol
	m.olplus=m.polplus
	m.olminus=m.polminus
	IF 	m.HC<=0
		m.HC=0.0030
	endif
	select 3
	go top
	scan for (punchparams.drawingnum)=(m.drawingnum)
		gather memvar
	endscan		
endscan

* replace heat treat and hardness in punchheader.dbf from dwgdata.dbf
select 2
go top
scan
	scatter memvar
	select 1
	go top
	scan for (punchheader.drawingnum)=(m.drawingnum)
		replace punchheader.hardness with m.ht
		replace punchheader.steel with m.steel
	endscan	
endscan

close tables 
*clear memory
* now follow the same procedures for the dies
use 'i:\data\ecnc\data\dieheader.dbf' in 1 shared
use 'i:\data\ecnc\data\dwgdata.dbf' in 2 shared
use 'i:\data\ecnc\DATA\dieparams.dbf' in 3 shared
set deleted on
set exact on

* search dieheader.dbf and add jobnum, numofparts and drawingnum to dieparams.dbf 
* if it doesn't exist, if numofparts>1, if length of jobnum>0
local lcJob, lnParts, llFound, lnDwgNum
select 1
scan 
	lcJob=alltrim(dieheader.jobnum) 
	lnParts=(dieheader.numofparts)
	lnDwgNum=val(alltrim(dieheader.drawingnum))
	select 3
	go top
	llFound=(.F.)
	scan for (alltrim(dieparams.jobnum))=(lcJob)	
		llFound=(.T.)
	endscan
	if llFound=(.F.) and (lnParts)>=1 and len(lcJob)>0
		append blank
		replace dieparams.jobnum with (lcJob)
		replace dieparams.numofparts with (lnParts)
		replace dieparams.drawingnum with (lnDwgNum)
		**use 0.001 squareness as a default value for all new records.
		replace dieparams.square WITH 0.0010
	endif		
endscan

* replace all drawing info in dieparams with that from dwgdata.dbf
* if drawing exists in dieparams
select 2
go top
scan 
	scatter memvar
	m.drawingnum=val(alltrim(dwgdata.drawingnum))
	m.ol=m.dol
	m.olplus=m.dolplus
	m.olminus=m.dolminus
	select 3
	go top
	scan for (dieparams.drawingnum)=(m.drawingnum)
		gather memvar
	endscan		
endscan

* replace heat treat and hardness in dieheader.dbf from dwgdata.dbf
select 2
go top
scan
	scatter memvar
	select 1
	go top
	scan for (dieheader.drawingnum)=(m.drawingnum)
		replace dieheader.hardness with m.ht
		replace dieheader.steel with m.steel
	endscan	
endscan
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform