ADO cannot access SQL Server XML type column using native client (SQLNCLI)

前端 未结 1 2116
小蘑菇
小蘑菇 2020-12-10 07:18

i am using ADO, and one of the \"native\" drivers (e.g. SQLNCLI, SQLNCLI10, SQLNCLI11) to connect to SQL Server (rather than

相关标签:
1条回答
  • 2020-12-10 07:41

    The MSDN documentation says

    To enable ADO to use new features of recent versions of SQL Server, some enhancements have been made to the SQL Server Native Client OLE DB provider which extends the core features of OLE DB. These enhancements allow ADO applications to use newer SQL Server features and to consume two data types introduced in SQL Server 2005: xml and udt. These enhancements also exploit enhancements to the varchar, nvarchar, and varbinary data types. SQL Server Native Client adds the SSPROP_INIT_DATATYPECOMPATIBILITY initialization property to the DBPROPSET_SQLSERVERDBINIT property set for use by ADO applications so that the new data types are exposed in a way compatible with ADO. In addition, the SQL Server Native Client OLE DB provider also defines a new connection string keyword named DataTypeCompatibility that is set in the connection string.

    So to enable the use of new SQL Server features in the Native Client, you need to add the following keywords in the connection string:

    Provider=SQLNCLI11
    DataTypeCompatibility=80
    

    where DataTypeCompatibility:

    Specifies the mode of data type handling to use. Recognized values are "0" for provider data types and "80" for SQL Server 2000 data types.

    0 讨论(0)
提交回复
热议问题