Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

XML and vbscript at server side

Featured Replies

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

Only few people here are with ODBC and XML skills.

But why do you use that? That your code looks almost in size like my whole shopping cart solution in CDML!

  • Author

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...

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.