Microsoft KB Archive/151974

= PRB: New Datasource Configuration Options in SQL Server 6.5 =

Article ID: 151974

Article Last Modified on 10/3/2003

-

APPLIES TO


 * Microsoft SQL Server 6.5 Standard Edition

-



This article was previously published under Q151974



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:

     \HKEY_LOCAL_USER\SOFTWARE\ODBC\ODBC.INI\ (for a user datasource)

\HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\ (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.</ol>

<div class="moreinformation_section">

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:

<ol> Use Trusted Connection</li> Save Long Running Queries

<ol style="list-style-type: lower-alpha;"> Query Logging Threshold (milliseconds)</li> Query Log File</li></ol> </li> Log Driver Statistics

<ol style="list-style-type: lower-alpha;"> Statistics Log File</li></ol> </li></ol>

The keywords used in the registry for these options are:

<ol> Trusted_Connection</li> QueryLog_On

<ol style="list-style-type: lower-alpha;"> QueryLogFile</li> QueryLogTime</li></ol> </li> StatsLog_On

<ol style="list-style-type: lower-alpha;"> StatsLogFile</li></ol> </li></ol>

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

Keywords: KB151974

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.