Link to home
Start Free TrialLog in
Avatar of StanChart
StanChart

asked on

Need some assistance configuring registry keys

Hi All,

I'm trying to programatically set registry keys to configure a Microsoft Access data source.  One problem I am having is after I set a REG_SZ key's value.  When I look at the key in the registry, the key's value shows up as "my keys value"...

Anyone know why there is a "..." after the key's value?  For some reason, this is not being read by the control panel's data source manager.

Here's my code:
*************************************************************
CString dbLocation = "C:\\database.mdb";
CString key = "Software\\ODBC\\ODBC.INI\\MY_DataSource";
HKEY hKey;
DWORD dwType = REG_SZ;

::RegCreateKeyEx(HKEY_LOCAL_MACHINE, key, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, &dwType);
::RegSetValueEx(hKey, "DBQ", 0, REG_SZ, (const unsigned char*)(LPCTSTR)dbLocation, MAX_PATH);

*************************************************************
There are other keys but I did not include them as it would be repetitive.

Thanks for your help.
ASKER CERTIFIED SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of StanChart
StanChart

ASKER

You're the man!