Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ALTER TABLE delete DBF from disk
Message
 
 
À
09/02/2006 07:08:32
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01094908
Message ID:
01095005
Vues:
11
>I have experienced problems when I have tried to add more than one field at a time. Try to do it one field at a time.

I think we found some problems with ALTER TABLE command back in VFP6. There was a limitation on number of fields you can add at a time. Also you can put ALTER table command in TRY/CATCH block and check the existance of the table.

Here is my old code, that did this: (NOTE the NOVALIDATE option)
lparameters tcTableName, tcCommandStr
local lcOldError, llError, lcTag
lcOldError=on('error')
on error llError=.t.
* invoke the ALTER TABLE – SQL Command with &-macro expanded tail
alter table (m.tcTableName) &tcCommandStr novalidate
do while m.llError and oValid.lContinue
	release laError
	=aerror(laError)
	if laError[1,1] = 1531 && cannot alter table because of index
	   	lcTag = laError[1,3]
		set message to 'Deleting tag '+ m.lcTag
		delete tag (m.lcTag)
		llError = .f.
		alter table (m.tcTableName) &tcCommandStr novalidate
	else
		exit
	endif
enddo
if m.llError
** Exited
	aerror(laError)
	=messagebox("Error: " + transform(laError[1,1])+chr(13)+laError[1,2], 48,"Alter table error")
endif
*set message to ' '			&& clear status bar msg.
on error &lcOldError
return m.llError
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform