INFO: Initialization Properties for SQLOLEDB OLE DB Provider

ID: Q193135

The information in this article applies to:


This article lists the intialization (ActiveX Data Objects [ADO] connection) properties that are available for the OLE DB Provider for SQL Server that is included with Visual Studio version 6.0, version 7.01.0502. While the Visual Studio documentation lists the initialization properties for the SQLOLEDB Provider, some of the property descriptions are incorrect and the documentation does not specify additional information such as the description names of the properties.


The name of the property is important for understanding what to use in an ADO connection string to set a property.

SQLOLEDB interprets OLE DB initialization and authorization properties as follows:

   ADO Connection string name/PropertyID      Description
   --------------------------------------     -----------------------------

   "Data Source"                              The SQL Server to connect to.

   "Initial Catalog"                          The SQL Server database.

   "Integrated Security"                      A string containing the name
   DBPROP_AUTH_INTEGRATED                     of the authentication
                                              service. The default value
                                              for this is VT_EMPTY.
                                              This can be set to "SSPI" or
                                              to a null BSTR pointer for
                                              Windows NT Integrated
                                              security (Secured
                                              Support Provider Interface).
                                              If SQL security is desired,
                                              the "Password" and "User ID"
                                              properties should be set

   "Locale Identifier"                        SQLOLEDB validates the locale
   DBPROP_INIT_LCID                           ID and returns an error if
                                              the locale ID is not
                                              supported or is not installed
                                              on the client computer.

   "Password"                                 The password assigned to a
   DBPROP_AUTH_PASSWORD                       SQL Server login. This
                                              property is used when SQL
                                              Server Authentication Mode
                                              is selected for authorizing
                                              access to a SQL Server

   "Persist Security Info"                    SQLOLEDB persists
   DBPROP_AUTH_PERSIST_SENSITIVE_AUTHINFO     authentication values,
                                              including an image of a
                                              password, if requested to do
                                              so. No encryption is

   "Prompt"                                   SQLOLEDB supports all
   DBPROP_INIT_PROMPT                         prompting modes for data
                                              source initialization.
                                              SQLOLEDB uses
                                              as its default
                                              setting for the property.

                                              DBPROMPT_PROMPT (1)
                                              Always prompt the user for
                                              intialization information.

                                              DBPROMPT_COMPLETE (2)
                                              Prompt the user only if more
                                              information is needed.

                                              DBPROMPT_COMPLETEREQUIRED (3)
                                              Prompt the user only if more
                                              information is needed.  Do
                                              not allow the user to enter
                                              optional information.

                                              DBPROMPT_NOPROMPT (4)
                                              Do not prompt the user.

   "User ID"                                  A SQL Server login. This
   DBPROP_AUTH_USERID                         property is used when SQL
                                              Server Authentication
                                              Mode is selected for
                                              authorizing access to a SQL
                                              Server database.

   "Window Handle"                            A window handle from the
   DBPROP_INIT_HWND                           calling application. A valid
                                              window handle is required for
                                              the initialization dialog box
                                              displayed when prompting for
                                              initialization properties is

   "Connect Timeout"                          SQLOLEDB returns an error on
    DBPROP_INIT_TIMEOUT                       initialization if a
                                              connection to the SQL Server
                                              cannot be established within
                                              the number of seconds
                                              specified. Approximately ten
                                              seconds is the lower limit.

The following properties are extended properties that are defined by the SQLOLEDB provider. All of the properties are read/write. The property IDs are defined in the Sqloledb.h file. Please see the REFERENCES section for more information about where to get the header file.

   ADO Connection String Name/PropertyID   Description
   -------------------------------------   ------------------------------

   "Application Name"                      The client application name.
   Type: VT_BSTR

   "Auto Translate"                        VARIANT_TRUE
   Type: VT_BOOL                           character conversion when
                                           multi-byte character strings
                                           are retrieved from, or sent
                                           to the SQL Server.

                                           SQLOLEDB does not perform
                                           OEM/ANSI character conversion
                                           on multi-byte character string

   "Current Languge"                       A SQL Server language name.
   NOTE: Note the incorrect                Identifies the language used
         spelling.                         for system message selection
   SSPROP_INIT_CURRENTLANGUAGE             and formatting.  The language
   Type: VT_BSTR                           must be installed on the SQL
                                           Server or data source
                                           initialization fails.

   "Network Address"                       The network address of the SQL
   SSPROP_INIT_NETWORKADDRESS              Server specified by the
   Type: VT_BSTR                           DBPROP_INIT_DATASOURCE

   "Network Library"                       The name of the Net-Library
   SSPROP_INIT_NETWORKLIBRARY              (DLL) used to communicate with
   Type: VT_BSTR                           the SQL Server. The name should
                                           not include the path or the
                                           .dll file name extension. The
                                           default is provided by the SQL
                                           Server client configuration.

   "Packet Size"                           A network packet size in bytes.
   SSPROP_INIT_PACKETSIZE                  The packet size property value
   Type: VT_I4                             must be between 512 and 32767.
                                           The default SQLOLEDB network
                                           packet size is 4096.

   "Use Procedure for Prepare"             SQL Server stored procedure
    SSPROP_INIT_USEPROCFORPREP             use. Defines the use of SQL
    Type: VT_I4                            Server temporary stored
                                           procedures to support the
                                           ICommandPrepare interface.

                                           SSPROPVAL_USEPROCFORPREP_OFF (0)
                                           A temporary stored procedure is
                                           not created when a command is

                                           SSPROPVAL_USEPROCFORPREP_ON (1)
                                           A temporary stored procedure is
                                           created when a command is
                                           prepared. The temporary stored
                                           procedures are dropped when the
                                           session is released.

                                      SSPROPVAL_ USEPROCFORPREP_ON_DROP (2)
                                           A temporary stored procedure is
                                           created when a command is
                                           prepared. The procedure is
                                           dropped when the command is
                                           unprepared with
                                           ICommandPrepare::Unprepare, or
                                           when a new command is specified
                                           for the command object with
                                           ICommandText::SetCommandText, or
                                           when all application references
                                           to the command are released.

   "Workstation ID"                        A string identifying the
   SSPROP_INIT_WSID                        workstation.
   Type: VT_BSTR

   "Initial File Name"                     This property is for future use
   SSPROP_INIT_FILENAME                    with SQL Server 7.0 database
   Type: VT_BSTR                           files.


The Sqloledb.h header file is not available with Visual Studio 6.0 or the Data Access Software Development Kit (SDK) 2.0. However, you can obtain the file by using the link in the following Microsoft Knowledge Base article:

   ARTICLE-ID: Q190725
   TITLE     : FILE: SqlOleDb.h Not Installed by VC++ 6.0

Additional query words: kbADO200 kbOLEDB kbSQLServ kbDatabase kbProvider
Version           : WINDOWS:2.0
Platform          : WINDOWS
Issue type        : kbinfo

Last Reviewed: October 5, 1998