02-13-2014 08:05 AM
I am using CVI 5.0.1 and would like to create ODBC entries without using the ODBC manager in Administrative Tools. I do not have access to the new CVI functions:
RegWriteString()
which would make it simple. Any sample code using the SDK functions such as RegSetValueEx would be helpful. I have written a sample program containing:
const char dname[] = "V2002ERR";
LONG kstat;
kstat = RegSetValueEx(HKEY_USERS,"Software\\ODBC\\ODBC.INI\\ODBC Data Sources",0,REG_SZ,dname,8);
It returns a 0, which is ERROR_SUCCESS, but does not write the key value. I am missing something somewhere.
Thanks in advance, David
02-13-2014 08:17 AM - edited 02-13-2014 08:19 AM
The instruction seems syntactically correct, but... which system are you running you app on? HKEY_USERS key does not contain a "Software" key, which can be found instead in HKEY_CURRENT_USER or HKEY_USERS\(userID) keys (at least on WinXP & Win7 systems).
Having said that, CVI5 is quite an old system that can have problems while running on systems from XP on
02-13-2014 08:22 AM
I'm running XP Pro. I am moving all my applications to Win 7 this year. Currently downloading the new CVI and if I can get that to create ODBC entries, then I will upgrade. Time to upgrade anyway.
Is this functionality (ODBC create) in the new SQL Toolkit?
Thanks, Dave