Consultor Eletrônico



Kbase 15842: Error 1006 and compiling code on the fly with multiple db
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/05/1998
Error 1006 and compiling code on the fly with multiple db

INTRODUCTION
============
This knowledgebase entry describes the reason for getting
error 1006 when using more than one database and compiling
code on the fly.

WHY YOU NEED TO KNOW THIS
=========================
When the RUN statement is used, Progress will try to find an
existing r-code file that corresponds to the procedure file
specified with the RUN statement. This includes temporary
r-code files that have compiled on the fly and still exist
in memory.

The could cause problems if you connect to more than database
with your application and try to compile the same program on
the fly for each of the different databases. Consider the
following example which connects to a copy of the sports
database and runs a program, then disconnects and connects to
another copy of sports and runs the same program.

connect sports -1.
run "test.p". /* test.p accesses the customer table */
disconnect sports.

connect mysports -1.
run "test.p".
disconnect mysports.

The above produces the following error:

"test.p Database mysports is not connected. (1006)"

PROCEDURAL APPROACH
===================
To eliminate the error and get test.p to be compiled and run
for each database, the compile statement can be used to
force a compile of the program for each database.

For example,

connect sports -1.
compile test.p.
run test.p.
disconnect sports.

connect mysports -1.
compile test.p.
run test.p.
disconnect mysports.

The above example does not produce error 1006 and compiles
test.p on the fly for each database.

REFERENCES TO WRITTEN DOCUMENTATION
===================================
PROGRESS Programming Handbook
PROGRESS Language Reference


Progress Software Technical Support Note # 15842