Full Address Search functionality
When using the COM Object, to search by Postcode to get Full address, we have two choices of implementation:
Simply use the "Sign Up for Trial" link at top right of this page to open a trial account. We will then send you a data key, which is used to identify your account, when using the following service.
The COM Object is for use with any COM compliant language. You have two choices to install the object on the target computer:
Simply run InstallSimplyPostcodeCOM.exe or InstallSimplyPostcodeCOM.msi from the root of our api example code as admin. This will install and enable the COM object without any user input.
InstallSimplyPostcodeCOM.exe
InstallSimplyPostcodeCOM.msi
If you wish to use from 64bit applications. You need to run Simply_COM_Obj_64Bits_register_fix.exe, as admin, which alters the registry to enable 64bit applications to use the 32bit COM object.
Simply_COM_Obj_64Bits_register_fix.exe
The Postcode Software COM Object is in the “COM Object\COM Object Files” directory of our api example code:
* = Needs to be registered as a COM object by install routine.
Add a COM Reference to our COM object, “ISimplyPostCodeCOMClass”SimplyPostCodeLookup.dll, within your programming language.
VB.NET Dim SimplyPostCodeLookup As New SimplyPostCode
Dim SimplyPostCodeLookup As New SimplyPostCode
The Data Key will have been sent to you via an e-mail when you opened the account. It is also available under the “Data Key” tab of the online admin window. For the .NET Assembly you should use the data key beginning with "I_".
VB.NET SimplyPostCodeLookup.SetDataKey(“I_KD352jKKHhk2GAFFKDU”)
SimplyPostCodeLookup.SetDataKey(“I_KD352jKKHhk2GAFFKDU”)
Simply call SearchForFullAddressWithDialogue(PostcodePrima, Caption, ShowLicienceDetails, AllowManageAccount, DisplayErrors)
SearchForFullAddressWithDialogue(PostcodePrima, Caption, ShowLicienceDetails, AllowManageAccount, DisplayErrors)
This call can be used with Local Data or Internet based data. But when using Local Data the advanced search is not available.
This function call will display a dialogue box for the user to enter the postcode to search for (or particial address words if using our Web Based data). The user then presses the [FIND] button, and a list of possible addresses is displayed for the entered postcode. The user selects an appropriate address record and the address is returned.
Returns true if address search completed and General_credits_display_text contains summary of Credits/License status.
This code displays the following Postcode Address Lookup window:
VB 6 Function GetAddressByPostcode() As Boolean On Error GoTo Error_loading Set SimplyPostCodeLookup = CreateObject("ISimplyPostCodeCOMClass.SimplyPostCode") SimplyPostCodeLookup.SetDataKey ("Your Data key") If SimplyPostCodeLookup.SearchForFullAddressWithDialogue("", "Get Address", true, true, true) then With SimplyPostCodeLookup me.CompanyName = .Address_Organisation me.Line1 = .Address_Line1 me.Line2 = .Address_Line2 me.Line3 = .Address_Line3 me.Town = .Address_Town me.County = .Address_County me.Postcode = .Address_Postcode end with end if Set SimplyPostCodeLookup = Nothing Exit_error: Exit Function Error_loading: MsgBox "Simply Post Lookup COM Object has not been installed on this PC !!! Please install using 'InstallSimplyPostcodeCOM.EXE'", vbCritical, "Simply Postcode Lookup software" Resume Exit_error End Function
Function GetAddressByPostcode() As Boolean On Error GoTo Error_loading Set SimplyPostCodeLookup = CreateObject("ISimplyPostCodeCOMClass.SimplyPostCode") SimplyPostCodeLookup.SetDataKey ("Your Data key") If SimplyPostCodeLookup.SearchForFullAddressWithDialogue("", "Get Address", true, true, true) then With SimplyPostCodeLookup me.CompanyName = .Address_Organisation me.Line1 = .Address_Line1 me.Line2 = .Address_Line2 me.Line3 = .Address_Line3 me.Town = .Address_Town me.County = .Address_County me.Postcode = .Address_Postcode end with end if Set SimplyPostCodeLookup = Nothing Exit_error: Exit Function Error_loading: MsgBox "Simply Post Lookup COM Object has not been installed on this PC !!! Please install using 'InstallSimplyPostcodeCOM.EXE'", vbCritical, "Simply Postcode Lookup software" Resume Exit_error End Function
VB.NET 'Set Data key, to identify your account SimplyPostCodeLookup.SetDataKey(Me.txtDataKey.Text) With SimplyPostCodeLookup If .SearchForFullAddressWithDialogue(Me.txtPostcode.Text, "Get address using simple call to .NET Assembly Object", True, True, True) Then Me.CompanyName.text = .Address_Organisation Me.Line1.text = .Address_Line1 Me.Line2.text = .Address_Line2 Me.Line3.text = .Address_Line3 Me.Town.text = .Address_Town Me.County.text = .Address_County Me.Postcode.text = .Address_Postcode End If End With
'Set Data key, to identify your account SimplyPostCodeLookup.SetDataKey(Me.txtDataKey.Text) With SimplyPostCodeLookup If .SearchForFullAddressWithDialogue(Me.txtPostcode.Text, "Get address using simple call to .NET Assembly Object", True, True, True) Then Me.CompanyName.text = .Address_Organisation Me.Line1.text = .Address_Line1 Me.Line2.text = .Address_Line2 Me.Line3.text = .Address_Line3 Me.Town.text = .Address_Town Me.County.text = .Address_County Me.Postcode.text = .Address_Postcode End If End With
This function adds an Advanced Find button to the search window provided by SearchForFullAddressWithDialogue call (See previous section). This allows users to enter address words to search for, to return Full address information:
SearchForFullAddressWithDialogue
When the Advanced Find button is pressed the following is displayed:
This advanced word search call can ONLY be used with Internet based data
Final step is to test, to enable easy testing please use our special test postcodes.
See section below for detail on data returned
Simply download the example code. The code is in the "COM Object/C++ COM Object","COM Object/MS Access 2000 onwards","COM Object/MS Excel using COM", "COM Object/VB6 COM Example","COM Object/VBNET COM 2005" directory of our example downloads.
You must run InstallSimplyPostcodeCOM.EXE included in the above download.
These examples demonstrate postcode lookup software using Full Address.
Firstly follow steps 1,2,3 and 4 above. Indeed the section above shows the princile behind this searching method.
Simply call GetFullAddressToList(Postcode), with the Postcode the user has entered in search box.
GetFullAddressToList(Postcode)
This call can be used with Local Data or Internet based data.
Returns true if address search completed and General_credits_display_text contains summary of Credits/License status. Else errors reported in General_errormessage.
General_credits_display_text
General_errormessage
And then call GetFullAddressLineForSelection() to get each line for list selection for display, discussed in next section.
GetFullAddressLineForSelection()
VB.NET 'Set Data key, to identify your account SimplyPostCodeLookup.SetDataKey(Me.txtDataKey.Text) Me.ListBox1.Items.Clear() With SimplyPostCodeLookup If .GetFullAddressToList(Me.txtPostcode.Text) Then 'Make list + Cancel button visible Me.ListBox1.Visible = True Me.ButCancelSelection.Visible = True 'Now Populate the List box Dim Line$ Line = .GetFullAddressLineForSelection() Do Until Line = "" Me.ListBox1.Items.Add(Line) Line = .GetFullAddressLineForSelection() Loop Else MsgBox(.General_credits_display_text & vbCrLf & .General_errormessage, vbCritical, "Simply Postcode Lookup") End If Me.Text = "Simply Postcode Lookup : " & .General_credits_display_text end With
'Set Data key, to identify your account SimplyPostCodeLookup.SetDataKey(Me.txtDataKey.Text) Me.ListBox1.Items.Clear() With SimplyPostCodeLookup If .GetFullAddressToList(Me.txtPostcode.Text) Then 'Make list + Cancel button visible Me.ListBox1.Visible = True Me.ButCancelSelection.Visible = True 'Now Populate the List box Dim Line$ Line = .GetFullAddressLineForSelection() Do Until Line = "" Me.ListBox1.Items.Add(Line) Line = .GetFullAddressLineForSelection() Loop Else MsgBox(.General_credits_display_text & vbCrLf & .General_errormessage, vbCritical, "Simply Postcode Lookup") End If Me.Text = "Simply Postcode Lookup : " & .General_credits_display_text end With
C# .NET string DataKey; DataKey = "Your Data Key" SimplyPostCodeLookup.SetDataKey(ref DataKey); ListBox1.Items.Clear(); string PostCodeToFind = txtPostcode.Text; if (SimplyPostCodeLookup.GetFullAddressToList(ref PostCodeToFind) == true) { //Make list + Cancel button visible ListBox1.Visible = true; ButCancelSelection.Visible = true; //Now Populate the List box string Line=""; Line = SimplyPostCodeLookup.GetFullAddressLineForSelection(); while (Line != "") { ListBox1.Items.Add(Line); Line = SimplyPostCodeLookup.GetFullAddressLineForSelection(); } } else { MessageBox.Show(SimplyPostCodeLookup.General_credits_display_text + " " + SimplyPostCodeLookup.General_errormessage, "Simply Postcode Lookup"); } this.Text = "Simply Postcode Lookup : " + SimplyPostCodeLookup.General_credits_display_text;
string DataKey; DataKey = "Your Data Key" SimplyPostCodeLookup.SetDataKey(ref DataKey); ListBox1.Items.Clear(); string PostCodeToFind = txtPostcode.Text; if (SimplyPostCodeLookup.GetFullAddressToList(ref PostCodeToFind) == true) { //Make list + Cancel button visible ListBox1.Visible = true; ButCancelSelection.Visible = true; //Now Populate the List box string Line=""; Line = SimplyPostCodeLookup.GetFullAddressLineForSelection(); while (Line != "") { ListBox1.Items.Add(Line); Line = SimplyPostCodeLookup.GetFullAddressLineForSelection(); } } else { MessageBox.Show(SimplyPostCodeLookup.General_credits_display_text + " " + SimplyPostCodeLookup.General_errormessage, "Simply Postcode Lookup"); } this.Text = "Simply Postcode Lookup : " + SimplyPostCodeLookup.General_credits_display_text;
Now get Address record, when user double clicks on address line in selection box
Calling GetFullAddressRecord(SelectedListIndex as long)
GetFullAddressRecord(SelectedListIndex as long)
VB.NET With SimplyPostCodeLookup If .GetFullAddressRecord(Me.ListBox1.SelectedIndex) Then Me.CompanyName.text = .Address_Organisation Me.Line1.text = .Address_Line1 Me.Line2.text = .Address_Line2 Me.Line3.text = .Address_Line3 Me.Town.text = .Address_Town Me.County.text = .Address_County Me.Postcode.text = .Address_Postcode Else MsgBox(.General_credits_display_text & vbCrLf & .General_errormessage, vbCritical, "Simply Postcode Lookup") End If Me.Text = "Simply Postcode Lookup : " & .General_credits_display_text End With
With SimplyPostCodeLookup If .GetFullAddressRecord(Me.ListBox1.SelectedIndex) Then Me.CompanyName.text = .Address_Organisation Me.Line1.text = .Address_Line1 Me.Line2.text = .Address_Line2 Me.Line3.text = .Address_Line3 Me.Town.text = .Address_Town Me.County.text = .Address_County Me.Postcode.text = .Address_Postcode Else MsgBox(.General_credits_display_text & vbCrLf & .General_errormessage, vbCritical, "Simply Postcode Lookup") End If Me.Text = "Simply Postcode Lookup : " & .General_credits_display_text End With
C# .NET int SelectedIndex=ListBox1.SelectedIndex; if (SimplyPostCodeLookup.GetFullAddressRecord(ref SelectedIndex)==true) { CompanyName.text = SimplyPostCodeLookup.Address_Organisation; Line1.text = SimplyPostCodeLookup.Address_Line1; Line2.text = SimplyPostCodeLookup.Address_Line2; Line3.text = SimplyPostCodeLookup.Address_Line3; Town.text = SimplyPostCodeLookup.Address_Town; County.text = SimplyPostCodeLookup.Address_County; Postcode.text = SimplyPostCodeLookup.Address_Postcode; } else { MessageBox.Show(SimplyPostCodeLookup.General_credits_display_text + " " + SimplyPostCodeLookup.General_errormessage, "Simply Postcode Lookup"); } this.Text = "Simply Postcode Lookup : " + SimplyPostCodeLookup.General_credits_display_text;
int SelectedIndex=ListBox1.SelectedIndex; if (SimplyPostCodeLookup.GetFullAddressRecord(ref SelectedIndex)==true) { CompanyName.text = SimplyPostCodeLookup.Address_Organisation; Line1.text = SimplyPostCodeLookup.Address_Line1; Line2.text = SimplyPostCodeLookup.Address_Line2; Line3.text = SimplyPostCodeLookup.Address_Line3; Town.text = SimplyPostCodeLookup.Address_Town; County.text = SimplyPostCodeLookup.Address_County; Postcode.text = SimplyPostCodeLookup.Address_Postcode; } else { MessageBox.Show(SimplyPostCodeLookup.General_credits_display_text + " " + SimplyPostCodeLookup.General_errormessage, "Simply Postcode Lookup"); } this.Text = "Simply Postcode Lookup : " + SimplyPostCodeLookup.General_credits_display_text;
These examples demonstrate postcode lookup software using Full Address your own User Interface.
This type of license returns: (see example below)
●see Additional Data Returned by Postcode Finder API for more information
The following return the status of the account and search:
VB.NET Public General_confirm As Boolean 'True if address data returned Public General_credits_display_text As String 'Shows number of Credits/Users available Public General_accountadminpage As String 'Gives URL of online account admin page 'From here the customer can be more Credits/Licenses Public General_errormessage As String 'Error Message if error Public General_credits_display_showbutton As Boolean 'True if should show button to buy more Credits/Licenses OPTIONAL
Public General_confirm As Boolean 'True if address data returned Public General_credits_display_text As String 'Shows number of Credits/Users available Public General_accountadminpage As String 'Gives URL of online account admin page 'From here the customer can be more Credits/Licenses Public General_errormessage As String 'Error Message if error Public General_credits_display_showbutton As Boolean 'True if should show button to buy more Credits/Licenses OPTIONAL