Connecting / Disconnecting

lee_shelton

New Member
Progress 8.2C SCO Unix.

We have several offices (identical structure databases with dot r's compiled against a common logical dbname 'dbempty'). Now, they want to fold the office into one and keep the databases on one machine. The problem is that they want the 'tie in' menu to run from an existing application program.

So they have to connect to one database and run the application that then gives them a list of databases. Quirky, I know.

But I can't get that top / first data base to disconnect.

When the users selects a different database, the db select program says 'disconnect dbempty' (the common logical name). I have debuggin messages that then show ldbname and pdname (0),(1),(2) are all unknown (?). But then, when the connect statement comes for the selected database it says **WARNING database dbempty is already connected.
Physical Database name 'db222' does not match 'db111', no connect.

The database selection program works fine from the Progress Editor, it's when being run from the older app that there's a problem.

I wonder if the older application has a transaction open. Would it show ldbname as ? even if the connection was held?

Is there a run-time handle (like session: ) that I can check to see if a transaction is open?
Sample code:
FUNCTION DropDB returns log ( ) .
message " BEFORE: " + chr(10)
" " pdbname(0) ldbname(0) + chr(10)
" " pdbname(1) ldbname(1) + chr(10)
" " pdbname(2) ldbname(2) + chr(10)
view-as alert-box.
if connected("dbempty" ) then
disconnect dbempty .

message " AFTER: " + chr(10)
" " pdbname(1) ldbname(1) + chr(10)
" " pdbname(2) ldbname(2) + chr(10)
" " pdbname(3) ldbname(3) + chr(10)
view-as alert-box.
return not connected("dbempty") .
END FUNCTION.

procedure dbConnect:
/** THE SELECTED Physical Name **/
def input param vDB as char.
DropDB().
connect value(vDB) -ld dbempty.
end procedure.

Thanks,
Lee
 
Top