Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Create ODBC data source


2 replies to this topic

ramaswamy

ramaswamy
  • Members
  • 25 posts

Posted 12 February 2002 - 17:25

Hi,

Having all the ODBC related files installed on the machine, is there a way to create an ODBC FileDSN through script.

Any ideas

Thanks in advance



Bill K

Bill K
  • Members
  • 21 posts

Posted 12 February 2002 - 22:45

I believe that you can use RegDBSetKeyValueEX with HKEY_CURRENT_USER\Software\ODBC\ODBC.INI as the key.  There may be many values to set and there may be other keys to adjust as well.

Ide Nentjes

Ide Nentjes
  • Members
  • 222 posts

Posted 13 February 2002 - 09:53

I strongly recommend against writing ODBC connections directly to the registry. I did that too, and it resulted in a perfectly working ODBC-DSN which for some strange reason was NOT visible in the ODBC-administration boxes.

The correct way to create a ODBC DSN is through the Windows API  SQLWriteFileDSN
I think it can be found in ODBCCP32.DLL

Success, Ide