Microsoft KB Archive/193135

= INFO: Initialization Properties for SQLOLEDB OLE DB Provider =

Article ID: 193135

Article Last Modified on 3/2/2005

-

APPLIES TO


 * Microsoft Data Access Components 2.0

-



This article was previously published under Q193135



SUMMARY
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.



MORE INFORMATION
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. DBPROP_INIT_DATASOURCE

"Initial Catalog"                         The SQL Server database. DBPROP_INIT_CATALOG

"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 instead.

"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 database.

"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                                             provided.

"Prompt"                                  SQLOLEDB supports all DBPROP_INIT_PROMPT                        prompting modes for data source initialization. SQLOLEDB uses DBPROMPT_NOPROMPT 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                                             allowed.

"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. SSPROP_INIT_APPNAME Type: VT_BSTR

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

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

"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 property.

"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                                           prepared.

SSPROPVAL_USEPROCFORPREP_ON (1) Default 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.

