>Article ID Q142216 shows how to create a Data Source programatically. The problem is that every time I create one it goes to the USER DSN location. I need to create one in the SYSTEM DSN location.
>
>Does anybody in here know how to do this? Thank you in advance.
I have not read the article, but if you're doing this via the registry, create it under HKEY_CURRENT_USER rather than under HKEY_LOCAL_MACHINE. It will only be visible to the user that is logged in at the time you create the DSN.
If you're calling SQLConfigDataSource, the second argument of the API call defines if it's a user or system DSB. THe following is cut from the ODBCINST.H file that comes with VC++
#define ODBC_ADD_DSN 1 // Add data source
#define ODBC_CONFIG_DSN 2 // Configure (edit) data source
#define ODBC_REMOVE_DSN 3 // Remove data source
#if (ODBCVER >= 0x0250)
#define ODBC_ADD_SYS_DSN 4 // add a system DSN
#define ODBC_CONFIG_SYS_DSN 5 // Configure a system DSN
#define ODBC_REMOVE_SYS_DSN 6 // remove a system DSN
#if (ODBCVER >= 0x0300)
#define ODBC_REMOVE_DEFAULT_DSN 7 // remove the default DSN
#endif /* ODBCVER >= 0x0300 */