Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Gendbc code and a .KRT file
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00571036
Message ID:
00571070
Vues:
22
This message has been marked as the solution to the initial question of the thread.
>I have inherited a Visual FoxPro 6.0 application from someone else. I want to add some fields to some of the files. I can do this just fine, but when I run the systems’ backup and restore routines the new fields disappear.
>
>The restore routine first runs a program that was created using FoxPro’s GenDBC program. He called the generated program CreateDB.prg to recreate all of the blank tables. I didn’t want to modify that file so I added the new fields and ran the GenDBC program. I replaced the original code with the code GenDBC created using my new layout. Now my project will not even compile.
>
>The error’s I get are:
>“Unable to find Unknown __RI_DELETE_CUSTOMER”
>“Unable to find Unknown VALID_CUSTOMER”
>I get these two errors for every table in the database.
>
>Both the original CreateDB code and my new code created by GenDBC has the lines:
>CREATE TRIGGER ON 'CUSTOMER' FOR DELETE AS __ri_delete_customer()
>ALTER TABLE 'CUSTOMER' SET CHECK valid_customer()
>
>I have found that in the Text Files section of my project is the file “CreateDB.KRT.” In this file are the functions that the CreateDB.prg program is trying to run. I don’t really know how the project knows how to use this file, but I haven’t removed it, so I don’t see why it would stop using it.
>
>The KRT file appears to also be created by FoxPro even though it doesn’t say it was like the code that comes from GenDBC. It does say:
>*** WARNING *** DO NOT MODIFY THIS FILE IN ANY WAY! *** WARNING ***
>* Table Validation Routines *
>
>I cannot find anything anywhere about a KRT file. When I ran GenDBC.prg, it did not appear to make a similar file (KRT or nay other) that had the functions used in the generated code.
>
>Any insight on this would be greatly appreciated.

The KRT file is created by GenDBC when it exports the stored procedures of your DBC to disk. The created program file has a section that knows how to parse the KRT file and append it back into the appropriate memo fields (StoredProceduresSource/StoredProceduresObjects).

If GenDBC didn't create a KRT file when it recreated your DBC, then it didn't see your stored procedures (and that is a problem). You may be able to fake it out by copying and renaming the current KRT file to the same name as your newly created DBC program. However, I'm not sure if that will because the necessary code to check for that stuff may not have been added to your program if no stored procedures were found.

I would suggest modifying a copy of the old generated program. That's what its for, IMO.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform