Recovering Index File Problems This set of tips describes two situations where you may find yourself unable to access your database file because of a problem with your index file. Your Q&A database is composed of two files. One contains the actual data and is named with your filename plus the suffix (or extension) .DTF. The other contains an index which is required by the program to enable you to access the actual datafile and it is named with your filename and the suffix (or extension) .IDX. So if you look at a directory listing on your disk which contains the database file, you will see the following included in the listing (example name ADDRESS): ADDRESS.DTF ADDRESS.IDX One of the following error messages will be displayed if the ADDRESS.IDX file is damaged or missing. SITUATION 1: The IDX file is missing - Reference #0678 or #0679 ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ You are running Q&A and you try to access ADDRESS but you find that the program does not recognize this as a Q&A database. For instance, you don't see it in the listing of files *.DTF in Search/Update in the File module. You do not receive an error message, it's simply not there. Exit Q&A through the X selection in the Main Menu and type in the following command in DOS while in your Q&A directory: DIR ADDRESS.* If this command responds by listing: ADDRESS.DTF but not ADDRESS.IDX, the index file has somehow been erased. The solution may be to copy another IDX file to the name ADDRESS.IDX. Use the copy command in DOS to give the following instruction: COPY EMPLOYEE.IDX ADDRESS.IDX This command creates a new ADDRESS.IDX file from the sample file provided on your original Q&A disk Number #6. It will probably be good enough to trick Q&A into letting you into your data base long enough to build a real index file. If you can, start up Q&A and go to step 7 in the numbered procedure that follows. If the above does not work, you will need to go through the first five steps. Q & A Application Note Rev. 6/92 #2009 Page 1 of 5 Recovering Index File Problems SITUATION 2: Error message reference #0694 ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ With the following procedure, you should be able to create a new, valid index file to replace one that gives an 0694 error. This procedure also applies if the method above did not work. These directions assume that you are working with Q&A installed on a hard disk system. The same methods will work with a dual floppy based system, but you will have to allow for the additional handling required by the floppy disk program. In this method, there will be two files involved, so for this example, we'll call them ADDRESS and NEW. ADDRESS will be the file with the damaged index and NEW is a newly created file. 1. You need to remember two things about your database: a) If you have ever used the Intelligent Assistant with this database, and b) How many Speed Search fields you have. 2. Create a new index file to use with your database. To do this move through the menus with the following selections: File, Design, type the name NEW for filename, then Design a new file. When you get to the design screen, create a form which has at least as many fields as your original database has Speed Search fields. You can play it safe by creating a couple of extra fields in NEW. The names, the sizes, the types and the formats of the fields do not matter. A five field form could look like this example: f1: f2: f3: f4: f5: After inputting the form, press F10 twice. This accepts the default for field type and format. Use ESC to return to the Q&A Main Menu. 3. Now select menu items in this order: File, Design, Customize (select the database NEW), Speed up Searches. If you have never used this part of the program before, you can refer to the appropriate section of your manual for background information (page F-87 in version 2.0, or F-114 in version 3.0). 4. In the Speed up Search screen, type an S into every field in the form and press F10 when you are through. When this is completed, you will be back at the Customize menu. Press ESC twice to return to the Q&A Main Menu. Q & A Application Note Rev. 6/92 #2009 Page 2 of 5 5. If you have never asked the Intelligent Assistant to review the forms in your database, skip this next step. If you wish to continue using the Intelligent Assistant then select "I" from the MAIN MENU and choose "Ask" from the Intelligent Assistant menu (use the database called "NEW"). You will be asked if the process of reviewing the forms should begin. Answer yes. The process will be very quick and then you will see the Intelligent Assistant Menu. Press Esc to return to the Q&A MAIN MENU. 6. Select X to exit Q&A to DOS. When you are returned to DOS, use the DOS copy command to replace the damaged index file, ADDRESS.IDX by NEW.IDX, like this: COPY NEW.IDX ADDRESS.IDX 7. Start Q&A again and move through the menus with the following selections: File, Design, Customize (select the database ADDRESS), and Speed up searches. 8. When you see the Speed up search screen, it will be from the ADDRESS file and some fields may contain an S. NOTE: Do a Printscreen or write down all 'S'; 'SU'; or 'SE' speedup fields. Clear the S's with the F3 key and press the F10 key. You will return to the Customize menu. 9. Select Speed up searches again. When you get the screen, put S's back in the desired fields and press F10. After the program completes rearranging the file, exit the Customize menu with ESC. 10. Whatever caused the index file problem may also have made trouble in the datafile. To ensure that your database is now error-free and to correct the Intelligent Assistant information in the index file, choose Copy from the FILE MENU. If you have been using the Intelligent Assistant then Copy the design with IA info, and then the forms, to a new file name. If you have not been using the IA then Copy design only, and then the forms. The Design copy will take a couple of minutes. To copy all of the forms, choose S from the Copy Menu and press F10 at the Retrieve spec and at the Merge spec. This process is slower, but when it is done, the new file will be free of problems. You'll know that the process has completed when it ends with the FILE MENU on your screen. Q & A Application Note Rev. 6/92 #2009 Page 3 of 5 Recovering Index File Problems SITUATION 3: Error message reference #0201 ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ The reference number 0201 means that Q&A has tried to open a structure called the Lexicon that is located in the .IDX portion of your database, but was unable to do so. This message is equivalent to the "File Not Properly Closed" message that results when you reboot or have an electrical problem while your Q&A file is still open, except that it has occurred in the .IDX (index) part of your database. Sometimes this error message can result as a "byproduct" of another problem that has occurred. To correct this situation here are two approaches: PROCEDURE A ÄÄÄÄÄÄÄÄÄÄÄÄ 1) Using the DOS utility called DEBUG type the following at the DOS prompt: DEBUG Replace filename with the name of your Q&A file and the drive and pathname if necessary. For example, C:\QA\ADDRESS.IDX If you receive the message INSUFFICIENT MEMORY - type Q and proceed to Procedure B below. E 120 xxxx:0120 FF.00 You type the 00 after the period and press Enter. W Q 2) You will return to the DOS prompt. Start Q&A. Go into the FILE MENU and choose Copy. The DOS prompt will now reappear. Start up Q&A and choose File form the Main Menu. In the File Menu, choose Copy, then copy the Design of the form to a new filename. When this is completed, choose Copy Selected Forms and copy to the same file you just created. Press F10 at the Retrieve and Merge Spec screens to begin copying. If this procedure finishes with no error message, the new file is in perfect shape. Use the new file and delete the old file. If you want to, you can go to the Utilities Menu and rename the new file so it has the same name as the old file did. Q & A Application Note Rev. 6/92 #2009 Page 4 of 5 Recovering Index File Problems PROCEDURE B ÄÄÄÄÄÄÄÄÄÄÄÄ If the index is too large to fit into memory using DEBUG.COM, or if you cannot find DEBUG.COM, then you can modify the file by typing in the BASIC program described below. NOTE: You should have BASICA.COM and your Q&A datafile in the same directory. At the DOS prompt type the following commands: BASICA ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ Substitute your file's ³ ³ name in place of ³ 10 OPEN "filename.IDX" AS #1 LEN=1 ³ filename.DTF, between ³ |ÄÄÄÄÄÄÄÄÄÄ|ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ the quotes. ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ 15 FIELD #1,1 AS C$ 20 RSET C$=CHR$(0) : PUT #1,&H21 : CLOSE Press the F4 key. The word "SAVE" will appear. Type in the name FIXIDX and press Enter. Now press the F2 function key to run the program. Type SYSTEM You should now make a copy of your file as described in PROCEDURE A above. SITUATION 4: Error message reference #0501 ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ If you've already experienced this message or if any of the above procedures result with this message then the IA part of your database must be removed. To do this make a copy of your database's design but without the IA information, and then copy your data to it as described in PROCEDURE A, item 2 of Situation 3 above. If you have a version of Q&A earlier than 2.0, call Symantec Technical Support. Q & A Application Note Rev. 6/92 #2009 Page 5 of 5