Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Program too large limitation - how does GENDBC avoid it?
Message
De
25/11/2004 11:19:01
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8
OS:
Windows 2000 SP2
Network:
Windows NT
Database:
Visual FoxPro
Divers
Thread ID:
00964376
Message ID:
00964705
Vues:
11
I was able to write a quick tool to generate the exact code I need to recreate the views using individual functions. That is how GenDBC avoids the problem. Below is a rough version if anyone cares. It has hardcoded paths, etc., but I'll clean it up at some point in the future; I just needed something quick for the current problem.
PARAMETERS tcTableName

CLOSE ALL
CLEAR
SET SAFETY OFF


LOCAL ;
	m.FileString, ;
	m.ViewFunctionsCalls, ;
	m.ViewFunctionStart, ;
	m.ViewFunctionEnd, ;
	m.ExtractedText, ;
	m.DropViewCode, ;
	m.WriteText

m.FileString = ''
m.ViewFunctionsCalls = ''
m.ViewFunctionStart = ''
m.ViewFunctionEnd = ''
m.ExtractedText = ''
m.DropViewCode = ''
m.WriteText = ''

m.FileString = FILETOSTR('d:\development\PlanMgmt.prg')

SELECT ObjectName FROM D:\DEVELOPMENT\PlanMgmt\DATA\PlanMgmt.DBC WHERE objecttype='View' AND (ALLTRIM(LOWER(tcTableName)) + '.')$LOWER(property) INTO CURSOR ViewsCursor

SCAN

	m.ViewFunctionsCalls = m.ViewFunctionsCalls + "MakeView_" + ALLTRIM(ViewsCursor.ObjectName) + "()" + CHR(13)
	m.ViewFunctionStart = "FUNCTION MakeView_" + ALLTRIM(ViewsCursor.ObjectName) + "()" + CHR(13)  + CHR(13)
	m.ViewFunctionEnd = "ENDFUNC" + CHR(13)  + CHR(13)
	m.DropViewCode = "IF INDBC('" + ALLTRIM(ViewsCursor.ObjectName) + "', 'view')" + CHR(13) + CHR(9) + "DROP VIEW " + ALLTRIM(ViewsCursor.ObjectName) + CHR(13) + "ENDIF" + CHR(13) + CHR(13)
	m.ExtractedText = STREXTRACT(LOWER(m.FileString),'function makeview_' + ALLTRIM(LOWER(ViewsCursor.ObjectName)),'endfunc') + CHR(13)  + CHR(13)
	m.WriteText = m.WriteText + m.ViewFunctionStart + m.DropViewCode + m.ExtractedText + m.ViewFunctionEnd

ENDSCAN

m.WriteText = m.ViewFunctionsCalls + CHR(13) + m.WriteText

=STRTOFILE(m.WriteText,'d:\development\ExtractFile.txt')

SET SAFETY ON
CLOSE ALL
CLEAR ALL
CLEAR

MODIFY COMMAND D:\DEVELOPMENT\ExtractFile.txt
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform