I have tried using the SQLConfigDataSource as follows:
Code Sample |
#include <stdio.h> #include <windows.h> #include <sql.h> #include <odbcinst.h> void main() { RETCODE retcode; UCHAR *szDriver = "SQL Server"; UCHAR *szAttributes = "DSN=SQL07\0" "UID=sa\0" "PWD=sa\0" "Address=SIS-003" "WSID=KAVERI\0" "SERVER=SIS-004\0"; retcode = SQLConfigDataSource(NULL, ODBC_ADD_DSN, szDriver, szAttributes); if(retcode) printf("Successful"); else printf("Unsuccessful"); } |
The retcode is unsuccessful.
One more matter is that I need to do the same in InstallShield Professional. Which is the DLL that contains this API? What are the other DLL(s) that are dependent on this DLL.