Dim xdoc As MSXML2.DOMDocument
Dim xmlStr As String
Dim cmd As ADODB.CommandSet cmd = New ADODB.Command
set xdoc As MSXML2.DOMDocumentxdoc.validateOnParse = True
xdoc.async = False
If (xdoc.Load("books.xml")) Then
xmlStr = xdoc.xml
Else
MsgBox xdoc.parseError.reason
End Ifcnn.CursorLocation = adUseClient
cmd.ActiveConnection = cnn
cmd.CommandText = "sp_xml_preparedocument" '存储过程的名称
cmd.CommandType = adCmdStoredProc '执行方式为存储过程'返回值参数
Set param = cmd.CreateParameter("RetVal", adInteger, adParamReturnValue, 4)
cmd.Parameters.Append param
'输出参数
Set param = cmd.CreateParameter("fileNo", adInteger, adParamOutput)
cmd.Parameters.Append param
'输入参数
Set param = cmd.CreateParameter("xmldoc", adVarChar, adParamInput, 8000, straaa)
cmd.Parameters.Append param
Set rs4 = cmd.Execute("SELECT * FROM OPENXML (@fileNo , '/ROOT/Customer',2) WITH (CustomerID varchar(10), ContactName varchar(20))")
Set xdoc = Nothing
Dim xmlStr As String
Dim cmd As ADODB.CommandSet cmd = New ADODB.Command
set xdoc As MSXML2.DOMDocumentxdoc.validateOnParse = True
xdoc.async = False
If (xdoc.Load("books.xml")) Then
xmlStr = xdoc.xml
Else
MsgBox xdoc.parseError.reason
End Ifcnn.CursorLocation = adUseClient
cmd.ActiveConnection = cnn
cmd.CommandText = "sp_xml_preparedocument" '存储过程的名称
cmd.CommandType = adCmdStoredProc '执行方式为存储过程'返回值参数
Set param = cmd.CreateParameter("RetVal", adInteger, adParamReturnValue, 4)
cmd.Parameters.Append param
'输出参数
Set param = cmd.CreateParameter("fileNo", adInteger, adParamOutput)
cmd.Parameters.Append param
'输入参数
Set param = cmd.CreateParameter("xmldoc", adVarChar, adParamInput, 8000, straaa)
cmd.Parameters.Append param
Set rs4 = cmd.Execute("SELECT * FROM OPENXML (@fileNo , '/ROOT/Customer',2) WITH (CustomerID varchar(10), ContactName varchar(20))")
Set xdoc = Nothing
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货