tailieunhanh - 1001 Things You Wanted To Know About Visual FoxPro phần 6
Tham khảo tài liệu '1001 things you wanted to know about visual foxpro phần 6', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Chapter 7 Working with Data 223 CLOSE ALL RETURN PROCEDURE CheckStProc DO dummy DO OnlyaCH07 DO OnlybCH07 If you run this program from the command line you will see that with multiple DBCs open calling a stored procedure which exists only in one DBC is does not matter which DBC is current the correct procedure is located. However if both DBCs contain a stored procedure that is named the same then the setting of the DBC is vitally important since Visual FoxPro will always search the current database first and only then will it search any other open databases. Finally if NO DBC is defined as current then Visual FoxPro executes the first procedure it finds - in this example it is always the dummy procedure in the aCH07 database container. Reversing the order in which the two DBCs are opened in the ShoStPro program changes the result for the last test. This suggests that Visual FoxPro is maintaining an internal collection of open databases in which the last database to be opened is at the head of the list and is searched first when no database is set as current. How to validate a database container Visual FoxPro provides a VALIDATE DATABASE command that will run an internal consistency check on the currently open database. Currently Version this command can ONLY be issued from the command window and by default its results are output to the main FoxPro screen. Attempting to use it within an application causes an error. You can validate a database without first gaining exclusive use but the DBC index will not be re-built nor will you be able to fix any errors that the process may find. With exclusive use you may choose either to rebuild the index a plain VALIDATE DATABASE command will do just that or to invoke the repair mechanism by adding the recover clause to the command. While not very sophisticated the recovery option at least highlights anything that VFP feels is wrong with your DBC and offers you options to either locate or delete a missing item and .
đang nạp các trang xem trước