I have an html page that will have a dropdown to various databases I can go to. Based on what they choose in the dropdown, how can I dynamically or programmatically create a connection string?This message has been edited. Last edited by: Kerry,
Version: 8.0.0.6 Windows platform All output formats will probably be used.
June 29, 2009, 04:36 PM
GinnyJakes
Have a -INCLUDE to a program that looks up the database type and credential information in a file that you have created, write the information to a SAVE file, then -READ into amper variables that you can use in the connect string. Then depending on the data base, you may need to set a default connection.
Here is an example of one for DB2 though you could make the engine type a variable as well.
ENGINE DB2 SET CONNECTION_ATTRIBUTES &CONN/&DB_user,&DB_pass
ENGINE DB2 SET DEFAULT_CONNECTION &CONN
You would have to put logic around this of course. And each program would need the -INCLUDE.
The other option is to encrypt the file, and set &ECHO to OFF, when processing.
Waz...
Prod:
WebFOCUS 7.6.10/8.1.04
Upgrade:
WebFOCUS 8.2.07
OS:
Linux
Outputs:
HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!
June 30, 2009, 09:29 AM
<JG>
quote:
ENGINE DB2 SET DEFAULT_CONNECTION &CONN
Set up the adapter connections in edasprof.prf and if you are using static ids and passwords and not user specific ones then that's all you need.
June 30, 2009, 01:55 PM
Kowens
but how do I get the value of &Conn from my html page to the engine?
Version: 8.0.0.6 Windows platform All output formats will probably be used.
June 30, 2009, 02:02 PM
GinnyJakes
How did you create your html page? Did you use the HTML Composer? Did you reference a focexec that had the amper variable &CONN in it. If the answer is yes, then the page's submit button will automatically provide the value of &CONN to the focexec.
I would suggest that you start smaller. Practice passing the value for country to a focexec against the car file until you understand that process.