cancel
Showing results for 
Search instead for 
Did you mean: 

Environment variables in ODBC DSNs

VolkerBarth
Contributor
2,758

Using SQL Anywhere on Windows, we prefer to use the SQL Anywhere environment variables like ASANY8 or SQLANY12 when specifying the path for the binaries.

While this works fine in batches and the Windows shell, it doesn't seem to work in ODBC DSNs when specifying the path for the StartLine command parameter. So the following won't work for the typical "SQL Anywhere 12 Demo" system DSN:

Startline = %SQLANY12%\\Bin32\\dbeng12.exe 

(From a technical point, this seems to be due to the fact that this parameter is stored in the registry with a REG_SZ type and not a REG_EXPAND_SZ type.)

Is my understanding correct?

And would it be possible to support environment variables in DSNs in future versions?

VolkerBarth
Contributor
0 Kudos

Could be possibly as useful for other path-containing parameters like DatabaseFile or Driver...

Breck_Carter
Participant
0 Kudos

...and xp_cmdshell calls too!

VolkerBarth
Contributor
0 Kudos

@Breck: I guess they somehow do work in xp_cmdshell but have problems with blanks in path names. Seems to be another question.

VolkerBarth
Contributor
0 Kudos

Sigh, I just stumbled over that pitfall again when doing tests with v17... - so I'd like to ask politely: Is this something that can be fixed or improved?

Accepted Solutions (0)

Answers (0)