Jump to content

XML and vbscript at server side


This topic is 8029 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hello!

We use this code on the browser type of page.. It uses browser vbscript. But we

allso need server side option for those with older browsers...

<HTML>

<HEAD><TITLE>Books in Inventory</TITLE></HEAD>

<BODY>

<H1>Funny Novels Inventory</H1>

<SCRIPT LANGUAGE="VBScript">

Dim rows, columns

Dim xmldoc

Set xmldoc = CreateObject("Microsoft.XMLDOM")

REM wait for the document to finish loading before continuing

xmldoc.async = false

REM validation isn't required; well-formedness isenough

xmldoc.validateOnParse = false

REM Load the XMl data from the database. Notice weuse the

REM FMPXMLRESULT grammar

xmldoc.load("http://xxxx.xxxx.com/fmpro?-db=eimitaan.fp5&-lay=outtti&-format

=-fmp_xml&-max=50&-find")

REM Here we go straight to the ROW elements; there'sone row per record

Set rows = xmlDoc.getElementsByTagName("ROW")

REM Format each record

For i=0 To (rows.length -1)

REM Put the fields of the record into the columns variable

Set columns = rows.item(i).getElementsByTagName("DATA")

REM Get each field from its known position

title = columns.item(0).text

isbn = columns.item(1).text

author = columns.item(2).text

price = columns.item(4).text

REM Wrap the data in HTMl and write it into the document

document.write("<h2>" + title + " by <i>" + isbn + "</i></h2> ")

document.write("<ul>")

document.write("<li>ISBN: " + author)

document.write("<li>Price: " + price)

document.write("</ul>")

Next

</SCRIPT>

<HR></HR>

</BODY>

</HTML>

This works great!

We need solution on server side asp-page that does the same. I tryed this:

<HTML>

<HEAD><TITLE>Books in Inventory</TITLE></HEAD>

<BODY>

<H1>Funny Novels Inventory</H1>

<%

Dim rows, columns

Dim xmldoc

Set xmldoc = Server.CreateObject("Microsoft.XMLDOM")

// wait for the document to finish loading before continuing

xmldoc.async = false

// validation isn't required; well-formedness isenough

xmldoc.validateOnParse = false

// Load the XMl data from the database. Notice weuse the

// FMPXMLRESULT grammar

xmldoc.load("http://xxxx.xxxx.com/fmpro?-db=eimitaan.fp5&-lay=outtti&-format

=-fmp_xml&-max=50&-find")

// Here we go straight to the ROW elements; there'sone row per record

Set rows = xmlDoc.getElementsByTagName("ROW")

// Format each record

For i=0 To rows.length -1

// Put the fields of the record into the columns variable

Set columns = rows.item(i).getElementsByTagName("DATA")

// Get each field from its known position

title = columns.item(0).text

isbn = columns.item(1).text

author = columns.item(2).text

price = columns.item(4).text

// Wrap the data in HTMl and write it into the document

response.write("<h2>" & title & " by <i>" & isbn & "</i></h2> ")

response.write("<ul>")

response.write("<li>ISBN: " & author)

response.write("<li>Price: " & price)

response.write("</ul>")

Next

%>

<HR></HR>

<br><br>

</BODY>

</HTML>

I gives us only a blank page...(source code is blank on between <%%>) Any

ideas why?

What should be done otherwise?

--

______________________________

Timo

Link to comment
Share on other sites

I can do many things with asp, what I can not do with CDML.

And I'd say I know CDML like my pocets, It's quite easy language.

But don't allow for example any calculations on page, lack of user regignation... Lack of session keys... Lack of filemanipulation on net pages. lack of overall security. Lack of security on viewing source code. And so on and so on..... Vbscipt allows us to do what we want. And we don't actually need to think how or can we do it. Vbscipt and MSSQL are much more stable than Filemaker and CDML. All tought we use raic with Filemaker....

And not so speedy on large databases (over 40 000 records with calculations)

Pluses using filemaker come from other side, like mass mailings, printing documents out and all kind of calculation handling. Easy, fast runtime production...

Link to comment
Share on other sites

This topic is 8029 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.