End Sub
Private Sub Form_Load()
Call initialize
Call getCustomerList
End Sub
Sub initialize()
' 从数据库返回命令名和相应的值
Dim sXML As String
Dim vRet As Variant
Dim F As Field
sXML = '<?xml version=''1.0''?>'
sXML = sXML & '<command><commandtext>Initialize</commandtext>'
sXML = sXML & '<returnsdata>True</returnsdata>'
sXML = sXML & '</command>'
Set RCommands = getRecordset(sXML)
Do While Not RCommands.EOF
For Each F In RCommands.Fields
Debug.Print F.Name & '=' & F.Value
Next
RCommands.MoveNext
Loop
End Sub
Function getCommandXML(command_name As String) As String
RCommands.MoveFirst
RCommands.Find 'command_name='' & command_name & ''', , adSearchForward, 1
If RCommands.EOF Then
MsgBox 'Cannot find any command associated with the name '' & command_name & ''.'
Exit Function
Else
getCommandXML = RCommands('command_xml')
End If
End Function
Sub getRecentProduct(CustomerID As String)
Dim sXML As String
Dim xml As DOMDocument
Dim N As IXMLDOMNode
Dim productName As String
sXML = getCommandXML('RecentPurchaseByCustomerID')
Set xml = New DOMDocument
xml.loadXML sXML
Set N = xml.selectSingleNode('command/param[name='CustomerID']/value')
N.Text = CustomerID
Set xml = executeSPWithReturn(xml.xml)
| 对此文章发表了评论 |
