From: Keith T. G. <kg...@re...> - 2007-08-24 18:40:54
|
Thanks for the quick reply, Patrick. Patrick van Kleef wrote: >> Clearly, everything should be in /Library/ODBC/odbc.ini, so I figure I'm >> missing some subtle trick. >> >> The code that actually writes the DSN is at >> http://code.crt.realtors.org/projects/ezrets/browser/ezrets/trunk/project/common/src/DataSource.cpp >> >> in the function at line 271 and its called from around line 233. >> > > I suggest you add a call to SQLSetConfigMode (ODBC_SYSTEM_DSN) before > you call the SQLWritePrivateProfileString function. I forgot to mention that my code is being called from ConfigDSN, which was called from the ODBC Administrator. I assumed that ODBC Administrator is calling that already. Before I went to write this reply, I added some quick test code to tell me if that was the case. In ConfigDSN I made a call to SQLGetConfigMode and it reported ODBC_SYSTEM_DSN. I also placed a call to SQLGetConfigMode write before the calls to SQLWritePrivateProfileString and that was also reporting ODBC_SYSTEM_DSN. So it appears my assumtion of ODBC Administrator setting that carries through. Would there be value to calling SQLSetConfigMode again even if SQLGetConfigMode is already set to that? Also, to give you some idea of what the resultant odbc files looks like, I've attached them. The one with my username at the start is the User one from my home directory. The one that is just Library.ODBC.odbc.ini comes from /Library/ODBC. Thanks again, Keith -- Keith T. Garner kg...@kg... "Make no little plans; they have no magic to stir men's blood." - Daniel H. Burnham |