安装时报错为 MDAC 2.8 RTM is incompatible with this version of Windows. All of its features are currently part of Windows.
The SQLXMLOLEDB Provider is an OLE DB provider that exposes Microsoft SQLXML functionality through ActiveX Data Objects (ADO). However, the provider can execute commands only in the "write to an output stream" mode of ADO. The SQLXMLOLEDB Provider is not a rowset provider. When you execute a command, you must specify the adExecuteStream flag, which directs ADO to use the output stream that you have specified.The following example shows the syntax for the Execute command in which the adExecuteStream flag is specified: Copy Code Dim oTestCommand As New ADODB.Command ... oTestCommand.Properties("Output Stream").Value = oTestStream oTestCommand.Execute , , adExecuteStream ...
the provider can execute commands only in the "write to an output stream" mode of ADO 这说明不能使用楼主的 ="provider=sqloledb;data source=xx;user id=sa;password=;Initial Catalog=xx;" 的方式
MDAC 2.8 RTM is incompatible with this version of Windows. All of its features are currently part of Windows.
Dim oTestCommand As New ADODB.Command
...
oTestCommand.Properties("Output Stream").Value = oTestStream
oTestCommand.Execute , , adExecuteStream
...
这说明不能使用楼主的
="provider=sqloledb;data source=xx;user id=sa;password=;Initial Catalog=xx;"
的方式
Const adExecuteStream = 1024Set conn = CreateObject("ADODB.Connection")
conn.Provider = "SQLXMLOLEDB.3.0"
conn.ConnectionString = ConnectionString
conn.Open Set cmd = CreateObject("ADODB.Command")
Set cmd.ActiveConnection = connSet stmXMLout = CreateObject("ADODB.Stream")
stmXMLout.Open
cmd.Properties("Output Stream") = stmXMLout
cmd.CommandText = "xx"
cmd.CommandType = 1
cmd.Properties("xml root") = "xx"
cmd.Properties("Base Path") = MyBasePath
cmd.Properties("xsl") = "xx.xsl"cmd.Execute, , adExecuteStream
当按原来的connectionstr="data provider=sqloledb;data source=xx;user id=sa;password=;Initial Catalog=xx;"运行时报错 为provider没有安装于是改为connectionstr="provider=sqloledb;data source=xx;user id=sa;password=;Initial Catalog=xx;"通过。但在Oracle下所有的Provider都显示不支持StreamOut。。我个人觉得语句没有问题。问题是不是需要安装SQLXMLOLEDB。现在不知道这个东西该怎么安装,而且怀疑安装后oracle下能不能适用。