PRB: DBC With Stored Procedure Produces Error When Opened (180028)
The information in this article applies to:
- Microsoft Visual FoxPro for Windows 5.0
- Microsoft Visual FoxPro for Windows 5.0a
- Microsoft Visual FoxPro for Windows 6.0
This article was previously published under Q180028 SYMPTOMS
When you attempt to open a database container (dbc) that contains stored
procedures, the following error can occur:
Object file c:\<dbcname>.dbc was compiled in a previous version
of FoxPro.
RESOLUTION- Duplicate the database container copying all the files into a new
database container in another folder. This includes files with a .dbc,
.dct, and .dcx extension.
- On the development computer used for building executable files for
remote sites, open the new database container with the newer version of
Visual FoxPro. The database container now converts automatically.
- Run the program named Gendbc.prg located in the \Vfp\Tools\Gendbc
folder. Select the .dbc file in question and remember the name and
location of the output .prg file it creates.
- Open the .prg file created by Gendbc.prg and copy the code that
resembles the code below.
NOTE: In the following code Test.krt and Test.dbc should be replaced
with the name that you gave the .prg file and the .dbc file.
********* Procedure Re-Creation *********
IF !FILE([Test.krt])
? [Warning! No Procedure File Found!]
ELSE
CLOSE DATABASE
USE 'test.dbc'
g_SetSafety = SET('SAFETY')
SET SAFETY OFF
LOCATE FOR Objectname = 'StoredProceduresSource'
IF FOUND()
APPEND MEMO Code FROM [Test.krt] OVERWRITE
REPLACE Code WITH SUBSTR(Code, 70, 66)
ENDIF
LOCATE FOR Objectname = 'StoredProceduresObject'
IF FOUND()
APPEND MEMO Code FROM [Test.krt] OVERWRITE
REPLACE Code WITH SUBSTR(Code, 136)
ENDIF
SET SAFETY &g_SetSafety
USE
OPEN DATABASE [Test.dbc]
ENDIF - Make a project and then create a .prg file within the project and paste
the code copied from step 4 into the .prg file.
- Build an executable making sure that the file with the .krt extension,
which was created by the Gendbc program, is placed in the folder with
the database container that needs to be converted.
- When you run the executable in the folder where the old database
container is located, the executable places the code from the .krt file
into the memo field of the database container that needs conversion.
When you run the executable that opens the database container, the .dbc
file should open correctly.
STATUS
This behavior is by design.
Modification Type: | Major | Last Reviewed: | 12/11/1999 |
---|
Keywords: | kbcode kbprb KB180028 kbAudDeveloper |
---|
|