Consultor Eletrônico



Kbase P64296: how to run a SDO against multiples identical databases using aliases in a development environment (w
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/16/2008
Status: Unverified

GOAL:

how to run a SDO against multiples identical databases using aliases in a development environment (with no compiled .r files)?

GOAL:

how to make the SDO look for the source code instead of the r-code ?

FACT(s) (Environment):

OpenEdge 10.x
Progress 9.x

FIX:

Follow the steps below to have the same SDO source code running against 2 databases, one each time, using alias "sales":

1 - create 2 sports databases: sports91d.db and mysports91d.db

2 - Create a smartwindow called wcustomer.w containing SDV and SDO and compile it connected to one of the databases above using logical database name "sales", and add the following command to the constructObject of the smartwindow before SUPER in order to have SDO looking for the source instead of .r:
DYNAMIC-FUNCTION('setRunDOOptions':U, INPUT 'sourceSearch':U).

4 - save the SDO making sure you have the appbuilder option "Qualify Database Fields with a Database Name" checked on, otherwise you will get error 1006 above.

3 - create a non-smart window with 4 buttons on it, each one containing the following code:

BUTTON-1:
DEF VAR myhdl AS HANDLE.

CONNECT sports91d.db -1.
CREATE ALIAS sales FOR DATABASE sports91d.
RUN wcustomer.w PERSISTENT SET myhdl.
RUN initializeObject IN myhdl.

BUTTON-2:

DEF VAR myhdl AS HANDLE.

CONNECT mysports91d.db -1.
CREATE ALIAS sales FOR DATABASE mysports91d.
RUN wcustomer.w PERSISTENT SET myhdl.
RUN initializeObject IN myhdl.


BUTTON-3:
DISCONNECT sports91d.
DELETE ALIAS sales.

BUTTON-4:
DISCONNECT mysports91d.
DELETE ALIAS sales.

4 - Run the program with no databases connected and choose button-1
Progress will connect to the sports91d using alias SALES and wcustomer.w will run.

5 - Choose BUTTON-3 and database sports91d will be disconnected and alias deleted.

6 - Choose BUTTON-2 Progress will connect to mysports91d and alias sales will be created.