Bookshelf Home | Contents | Index | PDF |
Siebel Finance Guide > Sample ASPs for Household Financial Accounts Virtual Business Components > ModelValueByClass.aspUse the following sample ASP to test retrieving data for the Class Allocation view. <%@ EnableSessionState=False Language=VBScript %> aConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" _ & "Data Source=C:\Inetpub\ibd\mdb.mdb" Set Conn = Server.CreateObject("ADODB.Connection") Conn.ConnectionString = aConnectionString SQL="SELECT * from ModelValueByClass" Set R=Server.CreateObject("ADODB.Recordset") aPath = Request.ServerVariables("PATH_TRANSLATED") ' strip the file name from the path aPath = Left(aPath, instrRev(aPath, "\")) aLogFile = aPath & "\log\ModelValueByClass.txt" set fs = Server.CreateObject("Scripting.FileSystemObject") set ts = fs.OpenTextFile(aLogFile, 8, True, 0) for each item in Request.ServerVariables ts.write Request.ServerVariables(item) set domDoc = Server.CreateObject("MSXML.DOMDocument") 'domDoc.setProperty("ServerHTTPRequest")=true set root = domDoc.documentElement 'inputText = Request.Form("textInput") Case "siebel-xmlext-fields-req" R.Open SQL, Conn, 3, 1, &H0001 domDoc.save (server.MapPath("init1.xml")) Response.Write "<?xml version= ""1.0"" encoding=""UTF-8""?>" Response.Write "<siebel-xmlext-fields-ret>" 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 'set mainNodes = root.childNodes set matchNodes = domDoc.SelectNodes("siebel-xmlext-query-req/match") For each matchNode in matchNodes set attribs = matchNode.attributes attName1(x) = attrib.nodeValue sWhere = sWhere & attName1(y) & " = " & """" & attVal1(y) & """" sWhere = sWhere & attName1(y) & " = " & """" & attVal1(y) & """ AND" 'setting the WHERE clause in order to query the correct recordset R.Open SQLwhere, Conn, 3, 1, &H0001 domDoc.save (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>" Response.Write "<value field="""& F.Name &""">"& F.Value &"</value>" 'ts.write "<value field="""& F.Name &""">"& F.Value &"</value>" Response.Write "</siebel-xmlext-query-ret>" 'ts.write "</siebel-xmlext-query-ret>" Case "siebel-xmlext-preinsert-req" Response.Write "<siebel-xmlext-preinsert-ret>" Response.Write "</siebel-xmlext-preinsert-ret>" Case "siebel-xmlext-insert-req" R.Open SQL, Conn, 3, 3, &H0001 set mainNodes = root.childNodes set matchNodes = domDoc.SelectNodes("siebel-xmlext-insert-req/row/value") For each matchNode in matchNodes set attribs = matchNode.attributes sFields = sFields & """" & attName(y) & """" sValues = sValues & """" & attVal(y) & """" sFields = sFields & """" & attName(y) & """, " sValues = sValues & """" & attVal(y) & """, " if (R.Supports(&H01000400)) then R.AddNew Array(sFields), Array(sValues) Case "siebel-xmlext-delete-req" |
Siebel Finance Guide | Copyright © 2018, Oracle and/or its affiliates. All rights reserved. Legal Notices. | |