stirnpanzer
asked on
Convert VB into lotusscript / XML
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,a ddress3,to wn,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,a ddress3,to wn,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 ACCOUNTCODE = "AAAAA11111"
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
lstProperties.Clear
While Not objRst.EOF
lstProperties.AddItem objRst.Fields("description ")
objRst.MoveNext
Wend
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.MoveFirst
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("orga nisation_n ame") <> "" Then
strLabel = strLabel & objRstAddress.Fields("orga nisation_n ame") & vbCrLf
End If
If objRstAddress.Fields("line 1") <> "" Then
strLabel = strLabel & objRstAddress.Fields("line 1") & vbCrLf
End If
If objRstAddress.Fields("line 2") <> "" Then
strLabel = strLabel & objRstAddress.Fields("line 2") & vbCrLf
End If
If objRstAddress.Fields("line 3") <> "" Then
strLabel = strLabel & objRstAddress.Fields("line 3") & vbCrLf
End If
If objRstAddress.Fields("post _town") <> "" Then
strLabel = strLabel & objRstAddress.Fields("post _town") & vbCrLf
End If
If objRstAddress.Fields("coun ty") <> "" Then
strLabel = strLabel & objRstAddress.Fields("coun ty") & vbCrLf
End If
If objRstAddress.Fields("post code") <> "" Then
strLabel = strLabel & objRstAddress.Fields("post code") & vbCrLf
End If
Me.lblAddress.Caption = strLabel
End Sub
Private Sub txtPostcode_Change()
End Sub
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,a
User then selects one, I want to then post the one selected again to return the exact :- number,address1,address2,a
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 ACCOUNTCODE = "AAAAA11111"
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
lstProperties.Clear
While Not objRst.EOF
lstProperties.AddItem objRst.Fields("description
objRst.MoveNext
Wend
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.MoveFirst
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("orga
strLabel = strLabel & objRstAddress.Fields("orga
End If
If objRstAddress.Fields("line
strLabel = strLabel & objRstAddress.Fields("line
End If
If objRstAddress.Fields("line
strLabel = strLabel & objRstAddress.Fields("line
End If
If objRstAddress.Fields("line
strLabel = strLabel & objRstAddress.Fields("line
End If
If objRstAddress.Fields("post
strLabel = strLabel & objRstAddress.Fields("post
End If
If objRstAddress.Fields("coun
strLabel = strLabel & objRstAddress.Fields("coun
End If
If objRstAddress.Fields("post
strLabel = strLabel & objRstAddress.Fields("post
End If
Me.lblAddress.Caption = strLabel
End Sub
Private Sub txtPostcode_Change()
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Abandoned question?