Convert VB into lotusscript / XML

Posted on 2003-03-17
Medium Priority
Last Modified: 2013-12-18
I have a "Desktop application" that needs to post a "Zip/Post code" that is validated and return various values.

I want it so the User enters the zip/post code in a field then uses a button to send/receive the data. To a 3rd party validation company.

It can return up to 15 results of :- number,address1,address2,address3,town,county,... per Zip/post code

User then selects one, I want to then post the one selected again to return the exact :- number,address1,address2,address3,town,county,... and from its result populate various address fields.

I have been supplied an example of the code in Visual basic and need to convert it in Lotusscript. Or perhaps into xml ???

See example VB code.

Const LICENSEKEY = "AA11-AA11-AA11-AA11"

Dim objRst As Recordset

Private Sub btnFind_Click()

Dim strUrl As String

'Build the URL
strUrl = "http://services.postcodecheck.com/recordset.aspx?"
strUrl = strUrl & "action=lookup"
strUrl = strUrl & "&account_code=" & ACCOUNTCODE
strUrl = strUrl & "&license_code=" & LICENSEKEY
strUrl = strUrl & "&postcode=" & Me.txtPostcode

'Get the data from Postcode Anywhere
Set objRst = New Recordset
objRst.Open strUrl

'Populate the list
While Not objRst.EOF
lstProperties.AddItem objRst.Fields("description")

End Sub

Private Sub Form_Load()

End Sub

Private Sub Label1_Click()

End Sub

Private Sub lblAddress_Click()

End Sub

Private Sub lstProperties_DblClick()

Dim strUrl As String
Dim objRstAddress As Recordset
Dim strLabel As String

'Find the selected item in the recordset to get the id
objRst.Move lstProperties.ListIndex

'Build the URL
strUrl = "http://services.postcodecheck.com/recordset.aspx?"
strUrl = strUrl & "action=fetch"
strUrl = strUrl & "&account_code=" & ACCOUNTCODE
strUrl = strUrl & "&license_code=" & LICENSEKEY
strUrl = strUrl & "&id=" & objRst.Fields("id")

'Get the data from Postcode Anywhere
Set objRstAddress = New Recordset
objRstAddress.Open strUrl

'Write the label
strLabel = ""
If objRstAddress.Fields("organisation_name") <> "" Then
strLabel = strLabel & objRstAddress.Fields("organisation_name") & vbCrLf
End If
If objRstAddress.Fields("line1") <> "" Then
strLabel = strLabel & objRstAddress.Fields("line1") & vbCrLf
End If
If objRstAddress.Fields("line2") <> "" Then
strLabel = strLabel & objRstAddress.Fields("line2") & vbCrLf
End If
If objRstAddress.Fields("line3") <> "" Then
strLabel = strLabel & objRstAddress.Fields("line3") & vbCrLf
End If
If objRstAddress.Fields("post_town") <> "" Then
strLabel = strLabel & objRstAddress.Fields("post_town") & vbCrLf
End If
If objRstAddress.Fields("county") <> "" Then
strLabel = strLabel & objRstAddress.Fields("county") & vbCrLf
End If
If objRstAddress.Fields("postcode") <> "" Then
strLabel = strLabel & objRstAddress.Fields("postcode") & vbCrLf
End If
Me.lblAddress.Caption = strLabel

End Sub

Private Sub txtPostcode_Change()

End Sub
Question by:stirnpanzer
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2

Accepted Solution

AndrewJayPollack earned 500 total points
ID: 8154269
The problem is there is no such "recordset" object.  Can you forward the definition of that object?
LVL 31

Assisted Solution

qwaletee earned 500 total points
ID: 8321062
Use GetDocumentByUrl it provides simialr functionailty, though you will have to do more parsing of the results yourself.
LVL 31

Expert Comment

ID: 9057602
Abandoned question?

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question