Siebel Finance Guide > Sample ASPs for Household Financial Accounts Virtual Business Components >


Use the following sample ASP to test retrieving data for the Cash Flow view.

<%@ EnableSessionState=False Language=VBScript %>

<% option explicit %>


Dim Conn


Dim R

Dim F

Dim RecsAffected

Dim aConnectionString

aConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" _

& "Data Source=c:\Inetpub\ibd\mdb.mdb"

Set Conn = Server.CreateObject("ADODB.Connection")

Conn.Mode = 3

Conn.ConnectionString = aConnectionString

Conn.CursorLocation = 3


SQL="SELECT * from cashflow"

Set R=Server.CreateObject("ADODB.Recordset")

dim v

dim fs

dim ts

dim sReq

Dim aPath

Dim aLogFile

dim item

aPath = Request.ServerVariables("PATH_TRANSLATED")

'Response.Write aPath

' strip the file name from the path

aPath = Left(aPath, instrRev(aPath, "\"))

' add the log file name

aLogFile = aPath & "\log\cash.log"

set fs = Server.CreateObject("Scripting.FileSystemObject")

set ts = fs.OpenTextFile(aLogFile, 8, True, 0)

'for each item in Request.ServerVariables

'ts.write item

'ts.writeline Request.ServerVariables(item)


dim domDoc

dim aFilename

set domDoc = Server.CreateObject("MSXML.DOMDocument")

domDoc.async = false



dim node

dim nodes

dim mainNode

dim mainNodes

dim matchNode

dim matchNodes

dim attribs

dim attrib

dim SQLwhere

Dim root

dim SQLinsert

dim SQLfields

dim SQLvalues

dim sWhere

dim x

dim y

dim sFields

dim sValues

set root = domDoc.documentElement

dim nName

dim inputText

dim data

'inputText = Request.Form("textInput")

nName = root.nodeName

Select Case nName

Case "siebel-xmlext-fields-req"

R.Open SQL, Conn, 3, 1, &H0001 (server.MapPath("init1.xml"))

Response.Write "<?xml version= ""1.0"" encoding=""UTF-8""?>"

Response.Write "<siebel-xmlext-fields-ret>"

For Each F in R.Fields

Response.Write "<support field='"& F.Name &"'/>"


Response.Write "</siebel-xmlext-fields-ret>"


Case "siebel-xmlext-query-req"

'This section of SelectCase is for the Query Request

dim attVal1(25)

dim attName1(25)

set mainNodes = root.childNodes

ts.writeline "Document have MainNodes: " & mainNodes.length

Dim z

z = 0

For each matchNode in MainNodes

'attVal1(z) = matchNode.text

'set attribs = matchNode.attributes

'set attrib = attribs(0)

'attName1(z) = attrib.nodeValue


ts.writeline "MainNode " & z

'ts.write z

ts.writeline "Main Node Name: " & matchNode.nodeName

ts.writeline "Main Node type: " & matchNode.nodeType

ts.writeline "Main Node value: " & matchNode.nodeValue

'ts.writeline "match Node data: " &

ts.writeline "Main line text: " & matchNode.text

'ts.write attrib.nodeValue

z = z +1


set matchNodes = root.SelectNodes("search-string")

ts.writeline "MatchNodes in document are : " & matchNodes.length

x = 0

For each matchNode in matchNodes

ts.writeline "Match string is :" & matchNode.text

sWhere = matchNode.text

x = x +1


ts.writeline "This is sWhere " & sWhere

'setting the WHERE clause in order to query the correct recordset

if sWhere="" then

SQLwhere = SQL


SQLwhere = " WHERE " & sWhere

SQLwhere = SQL + SQLwhere

end if

'Response.Write SQLwhere

R.Open SQLwhere, Conn, 3, 1, &H0001

'for debugging (server.MapPath("init2.xml"))

'build response stream by iterating through the recordset

Response.Write "<?xml version= ""1.0"" encoding=""UTF-8""?>"

Response.Write "<siebel-xmlext-query-ret>"

'ts.write "<?xml version="1.0" encoding="UTF-8"?>"

'ts.write "<siebel-xmlext-query-ret>"

While Not R.EOF

Response.Write "<row>"

'ts.write "<row>"

For Each F in R.Fields

Response.Write "<value field="""& F.Name &""">"& F.Value &"</value>"

'ts.write "<value field="""& F.Name &""">"& F.Value &"</value>"


Response.Write "</row>"

'ts.write "</row>"



Response.Write "</siebel-xmlext-query-ret>"

'ts.write "</siebel-xmlext-query-ret>"


Case "siebel-xmlext-preinsert-req"

'Section for PreInsert

Response.Write "<siebel-xmlext-preinsert-ret>"

Response.Write "<row></row>"

Response.Write "</siebel-xmlext-preinsert-ret>"

Case "siebel-xmlext-insert-req"

'Section for Insert

Case "siebel-xmlext-delete-req"

'Section for Delete

End Select

'cleaning up the objects in memory


set root = Nothing

set domDoc = Nothing

set ts = Nothing

set fs = Nothing

Set R = Nothing


Set Conn = Nothing


Siebel Finance Guide