I got an interesting one. I want to retrieve the DSN information from our servers and I created the following relevance that gets the names of the DSN connections and what type they are.
(((name of it & " = " & it as string)of values of it)) of key “HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources” of registry
Now, I need to be able to get the actual details of each DSN. Under the registry key HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\ it has each DSN listed as a key with the details that I need as values. The problem is, there are 2 keys in this thread that are NOT DSN’s. One is the ODBC Data Sources Key and the other is ODBC File DSN. How would I be able to get the values of the DSN’s from the name of the keys I retrieved from my relevance and NOT anything else?
This will give you the name of each of the keys under ODBC.INI followed by the concatenation of its values, except the two ODBC keys:
(name of it & " = " & (concatenation "; " of (it as string) of values of it)) of keys whose (name of it != “ODBC Data Sources” AND name of it != “ODBC File DSN”) of key “HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI” of registry
You can add more logic to get only specific values or to list the results differently. If you’re having trouble, post an example of the output format you’d prefer.
DSN Name = bes_bfenterprise ; Value Name = Value Result ?
Each key has dword names so could you have the dword names + their value?
For instance, under bes_bfenterprise there are 4 dword values named ‘Database’, ‘Driver’, ‘LastUser’, ‘Server’ and each has a value of it. Can they be listed out as such?
(name of it & ": " & (concatenation "; " of (name of it & “=” & it as string) of values of it)) of keys whose (name of it != “ODBC Data Sources” AND name of it != “ODBC File DSN”) of key “HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI” of registry
(“DSN=” & name of it & ": " & (concatenation "; " of (name of it & “=” & it as string ) of values whose (name of it = “Server”) of it)) of keys whose (name of it != “ODBC Data Sources” AND name of it != “ODBC File DSN”) of key “HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI” of registry
(“DSN=” & name of it & ": " & (concatenation "; " of (name of it & “=” & it as string ) of values whose (name of it = “Server”) of it)) of keys whose (name of it != “ODBC Data Sources” AND name of it != “ODBC File DSN” AND exists value whose (name of it = “Server”) of it) of key “HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI” of registry