PRB: New Datasource Configuration Options in SQL Server 6.5

ID: Q151974


The information in this article applies to:
  • Microsoft SQL Server version 6.5


SYMPTOMS

When you call the SQLConfigDataSource API with a NULL window handle to configure a SQL Server 6.5 ODBC datasource silently, and you try to set the new setup options introduced in the 6.5 driver, the information will not be written to the Odbc.ini or the registry. However, SQLConfigDataSource returns TRUE as the return code.

See the More Information section in this article for a list of the new setup options.


CAUSE

In the current implementation, the new setup options can only be configured interactively in the driver setup dialog box.


WORKAROUND

  • Pass a valid hwnd to SQLConfigDataSource and have the users manually check or select the new options in the resulting datasource setup dialog box.


  • In case you absolutely have to do a silent datasource configuration, call the SQLWritePrivateProfileString API and modify the registry after silently calling SQLConfigDataSource. If you follow this approach, it is recommended that you use the ODBC administrator to configure a datasource, note the entries made in the registry and then use those entries in SQLWritePrivateProfileString. Note that, in the registry, the datasource entries will be written under the following keys:
    
          <Your machine>\HKEY_LOCAL_USER\SOFTWARE\ODBC\ODBC.INI\<your
          datasource> (for a user datasource)
    
          <Your machine>\HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\<system
          datasource> (for a system datasource)
      
    For more information on using SQLWritePrivateProfileString, please refer to the README25.TXT (Windows\System32 or System) that comes with the ODBC 2.5 components.


  • You can also set these options at the connection level, if you are using the ODBC API in your application. For more information, refer to the "Driver-Specific Connection Options" in the SQL Server Books Online.



MORE INFORMATION

The SQL Server driver v2.65.0201 has three new options for the datasource setup. In the ODBC administrator for a SQL Server 6.5 datasource, these are listed as:

  1. Use Trusted Connection


  2. Save Long Running Queries

    1. Query Logging Threshold (milliseconds)


    2. Query Log File




  3. Log Driver Statistics

    1. Statistics Log File





The keywords used in the registry for these options are:
  1. Trusted_Connection


  2. QueryLog_On

    1. QueryLogFile


    2. QueryLogTime




  3. StatsLog_On

    1. StatsLogFile





Additional query words: MFC 'Database Classes' RDO Access DAO Visual C++ Visual Basic

Keywords :
Version : 2.65.0201
Platform : WINDOWS
Issue type :


Last Reviewed: March 25, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.