Programmatically changing db-path

Author: roger.wallin@abilita.fi (rogerw)

Hi, having the following asn-assignments: $MSS1  MSS:server1:db1|?|? $MSS2  MSS:server2:db2|?|? $DEF $MSS1 Can I somehow programmatically assign $DEF to $MSS2 ? $DEF  $MSS2  Regards RogerW.   PS. I know that in this situation I could probably use "open" to change server and db.  $MSS1 MSS:?|?|?

6 Comments

  1. Hi Roger, AFAIK as of 9.7 is NOT possible to dinamically change asn file content...nevertheless: 1) If you have NOT encrypted your assignment file you could mix the two tecniques to depend only from your assignment settings: - Use $settings to retrieve your second path from the assignment file - Use close/open to reopen your DEF path using parameters 2) If you have encrypted your assignment file you can only duplicate your logon parameter, saving it somewhere and using it with a close/open Regards, Gianni


    Author: gianni (gianni.sandigliano@unifacesolutions.com)
  2. Hi Gianni and others, We have sometimes in the past developed a system for hiding/encrypting user and password, but not the server and database. The problem is that I can't use "open" to reassign $DEF as there isn't a question mark "?" set for server and database. I need a way to programmatically change $DEF (even server and database) although server and database is "hardcoded" in the ASN-file. Can I do that? ASN: $MSS1  MSS:server1:db1|?|? $DEF $MSS1 Regards RogerW.


    Author: rogerw (roger.wallin@abilita.fi)
  3. Hi RogerW. IIRC, the ASN files are evaluated only once in the application start-up. So even when we change the text in an ASN file, there is no "re-evaluate-asn" trigger option.


    Author: ulrich-merkel (ulrichmerkel@web.de)
  4. Hi Ulrich-Merkel and others, you probably remember correctly. I just hoped for some undocumented feature allowing to totally reassign the $DEF in code, ie. ASN-file: $MSS1  MSS:server1:db1|?|? $MSS2  MSS:server2:db2|?|? $DEF $MSS1 Code: $DEF = $MSS2 But I have to see if our encrypt/decrypt-program easily would support three question-marks. $MSS1  MSS:?|?|? Regards RogerW.


    Author: rogerw (roger.wallin@abilita.fi)
  5. You can't change  the $DEF value on real time. Well, you can overwrite the ASN file line, but has no effect on the active uniface session.   My approach was to add multiple DMBS paths to the asn file and encode the file with pathscrambler.exe, using open and close.   Another approach consist on only define the alias and DBmnemonic. Like: $ALT=ORA: And create a table of DBMS paths on your default  data base.   vsSql="select 'ORA:'||dbms_ip||':'||dbms_port||'/'||dbms_sid||'|'||user||'|'||pass||'|' FROM V_DMBS where sede_id='%%drop_dbms.aux'" sql/data vsSql,"DEF" vs_connection=$result close "$ALT" open vs_connection,"$ALT"


    Author: fearandir (fearandir@gmail.com)
  6. fearandir said ... Another approach consist on only define the alias and DBmnemonic. Like: $ALT=ORA: And create a table of DBMS paths on your default  data base. ...  

    OK, I/We are using it too for all specific connections to outside from our application context. Regards, Gianni


    Author: gianni (gianni.sandigliano@unifacesolutions.com)