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

DSN Properties


2 replies to this topic

arfinsd

arfinsd
  • Members
  • 28 posts

Posted 01 October 2002 - 19:55

Hey everyone,

I'm using IS Developer 7, and I created a DSN with the program. In the settings, I have the Library Type Settings set to TCP/IP, but when I install the DSN....it gets set to Named Pipes. Does anyone have or know how I can set this manually through the script after the DSN has been installed.

I call a function that configures the server name, and was wondering if I could just do it at that time, but I'm not sure how to set it.

Alex
Alex Ferguson
www.SolimarSystems.com

arfinsd

arfinsd
  • Members
  • 28 posts

Posted 28 October 2002 - 17:42

Just in case anyone is interested, I found the answer....

if (UseDLL( SUPPORTDIR ^ MY_DLL ) < 0) then
  MessageBox("Could not load the support DLL " + MY_DLL  "  
           into memory.", SEVERE);  
else
     szArgs  = "DSN=MYDSNNAME|" +
     "Description=My DSN|" +
     "Network=DBMSSOCN|" +  // Specifies TCP/IP
     "Server=" + ServerName + "|";
 
// Replace all semicolons with NULL characters to create
// null-delimited, double-NULL terminated string, which is the
// format needed to pass to SQL functions.

    szArgs = szArgs + '|';
    nvLen = StrLength ( szArgs );
    nvLen = nvLen - 1;
    nCount = 0;
    for nCount = 0 to nvLen
      if ( szArgs[nCount] = '|' ) then
         szArgs[nCount] = '\0';
      endif;
    endfor;
       
// ****
// This function utilizes the SQLConfigDataSource() function
// I created this function in my DLL, and it calls
// SQLConfigDataSource()....check the help for the
// parameters. The most errors come from szArgs not being
// built right.
// ****
 nRes = ConfigureODBCDSN("SQL Server", szArgs);

 if (nRes = FALSE) then
   MessageBox ( "SQLConfigDataSource Error - Cannot
           configure the SOLsearcher DSN. Please refer to the
           documentation to set this up manually.", MB_OK );
endif;  
   
if (UnUseDLL( SUPPORTDIR ^ MY_DLL ) < 0) then
  MessageBox("Could not unload the support DLL " + MY_DLL
            + "  from memory. Still in memory.", WARNING);
endif;
Alex Ferguson
www.SolimarSystems.com

arfinsd

arfinsd
  • Members
  • 28 posts

Posted 28 October 2002 - 17:44

also, I could have modified the Registry directly, but found that when testing the DSN, it would fail until I clicked on "Client Configuration". As soon as I clicked this, it would work....so something was missing, I would recommend using SQLConfigDataSource() for updating the DSN....
Alex Ferguson
www.SolimarSystems.com