Is it possible to determind the databases connected to a specific program?

dayv2005

Member
I was wondering if there was any way to determined what database or databases need to be connected to compile a program.

Is there a way to pass, let's say, a file location and in return it outputs the databases that need to be connected to compile that?
 

rstanciu

Member
If your application >= 10 use these startup params for the client:

-clientlog clientlog.txt
-logginglevel 4
-logentrytypes DB.Connects,FileID,4GLMessages,4GLTrace,QryInfo
-clearlog
-logthreshold 1000000
-numlogfiles 3
-debugalert
-errorstack
-yc
-yx
 

KrisM

Member
Or you could use rcode-info.

rcode-info:file-name = "...r".
MESSAGE rcode-info:table-list
VIEW-AS ALERT-BOX INFO BUTTONS OK.

This will give you database names AND table names, but it is still better to have too much info than not enough. :awink:
 

dayv2005

Member
Thanks the rcode-info:Db-references worked fine. Almost exactly what i was looking for. If i could only get that info from a .p.

But over all this should work.
 
I was wondering if there was any way to Is there a way to pass, let's say, a file location and in return it outputs the databases that need to be connected to compile that?

No, although some IDE contexts will store the info (eg. SmartObjects).

Think of it this way: the source file that you wish to test could have been generated by anything including non-Progress editors down to notepad, and may be invalid against any database, or compileable against multiple databases (including ones not intended), and may be a non-Progress source or even a random text or raw file. ".p" guarantees nothing.

You are asking for a function like this:

WhichDBDoesSourceRequire(textFilename)

when the best you can do is:

IsSourceValidAgainstThisDB(dbName, textFileName).

Hence the need to inspect rcode, where the validity has already been proven, and is guaranteed against the references within.

If that makes sense.
 

sdjensen

Member
Unless you use <databasename>.<table> as references in your .p program there is no way the program knows with databases are required.

The same table-name can be in more than one database.
 
Top