Go Back   Access World Forums > Microsoft Access Reference > Sample Databases

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 05-28-2018, 01:30 PM   #1
ridders
Newbee moderator
 
ridders's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 5,562
Thanks: 79
Thanked 1,379 Times in 1,286 Posts
ridders is a jewel in the rough ridders is a jewel in the rough ridders is a jewel in the rough ridders is a jewel in the rough
Get current geolocation data using Access

This follows on from a recent thread at https://www.access-programmers.co.uk...ht=geolocation

After making further modifications to fix various issues e.g. Mark of the Web (MOTW), attached is an improved utility for determining your current geolocation in Access.
All supplied files need to be in the same folder



To use this, click 'Get Current Location'. A browser window will open and ask permission to obtain your location.



Click the 'Allow Once' button within 3 seconds to do so
Your current location should be shown on the map & your latitude / longitude displayed.

The browser window will then close & the geolocation data shown in Access together with a static map centred on that. The map can be nudged or zoomed as required.
Reverse geocoding is also used to obtain a shortened address for the location which should be accurate to within a few metres.

If you don't click the button in time, you will be offered further 'chances' to do so

The example database was created in Access 2010 32-bit and Windows 10.
However, it has been successfully used in all versions of Access from 2007 through to 2016 (both 32-bit & 64-bit).
It works in any version of Windows from Win7 SP1 onwards

NOTE:
Some caveats:
1. You must switch on location services in Windows settings / Control Panel
2. Your computer must contain a geosensor (all tablets / many laptops / not many desktops)
3. There is a bug affecting Internet Explorer in the latest update 1803 to Windows 10.
The browser window will report "Error - the geolocation service failed"
It doesn't matter which browser is your default, IE is always used by Access for browser related code.
I have reported this to Microsoft who have acknowledged it as a bug for attention (when?)
4. The form includes an ActiveX slider control - this will not work if you have disabled ActiveX completely in Access settings

If you cannot get your location for any of the above reasons (or to do this for another location), you can obtain latitude & longitude data in other ways e.g.
a) Open Google maps to your current location
b) Use GPS data from a mobile phone or other device with a geosensor
c) Use a Windows app such as Sensor List or Geolocator (free from the Windows Store)
d) Take a photo using your PC webcam then use the GPS data from the photo properties
Enter the values on the form then click 'Search'

IMPORTANT NOTE:
The geolocation code & map requires a Google Maps API key.


The supplied API key will stop working on (or before) 16 July 2018 (postponed from 11 June) when Google will require users to enable billing and associate it with all Google Maps Platform projects. However there is a fairly generous monthly free allowance & small/medium users of Google Map APIs should still be able to download various maps without incurring charges

Please follow the instructions on this form to obtain your own free API key from https://cloud.google.com/maps-platform and use it in place of the existing key.
You will need to enable THREE map APIs: Static Maps / Javascript Maps / Geocoding



==========================================

FURTHER INFO:
An enhanced version of this utility is included in the next version of my UK Postal Address Finder database (to be released early June 2018)
It is used to locate the nearest postcodes for the current location (or any other geolocation).
That info is then used to find nearby places within a specified radius e.g. restaurants within 500 metres
If you are interested, please see the attached video
Attached Images
File Type: jpg LocationMap.jpg (95.7 KB, 305 views)
File Type: png IEMap1.PNG (88.0 KB, 294 views)
File Type: png APIInfo.PNG (41.2 KB, 298 views)
Attached Files
File Type: zip GetLocation2.5.zip (236.8 KB, 97 views)
File Type: zip Postcode Geolocation Video.zip (1.71 MB, 74 views)

__________________
Colin
Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left and leave a comment.

New example databases:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


-------------------------
nil illegitimi carborundum est

Last edited by ridders; 06-23-2018 at 12:55 AM.
ridders is offline   Reply With Quote
The Following User Says Thank You to ridders For This Useful Post:
wind20mph (06-08-2018)
Old 06-21-2018, 05:24 PM   #2
ridders
Newbee moderator
 
ridders's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 5,562
Thanks: 79
Thanked 1,379 Times in 1,286 Posts
ridders is a jewel in the rough ridders is a jewel in the rough ridders is a jewel in the rough ridders is a jewel in the rough
Re: Get current geolocation data using Access

UPDATE
The bug I mentioned in the previous post affecting IE geolocation service in Windows 1803 has now been fixed by MS!

The following is taken from the notes for the Windows update released on June 12, 2018
https://support.microsoft.com/en-gb/help/4284835

Quote:
KB4284835 (OS Build 17134.112)

Applies to: Windows 10 version 1803
Improvements and fixes
This update includes quality improvements. No new operating system features are being introduced in this update. Key changes include:
...
Addresses an issue with Internet Explorer that prevents it from using an updated version of location services.
...
I've tested it and it does indeed now work again. That took around 3 weeks - better than I expected....
__________________
Colin
Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left and leave a comment.

New example databases:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


-------------------------
nil illegitimi carborundum est
ridders is offline   Reply With Quote
Old 06-28-2018, 10:44 AM   #3
Juleehz
Newly Registered User
 
Join Date: May 2018
Posts: 3
Thanks: 3
Thanked 0 Times in 0 Posts
Juleehz is on a distinguished road
Re: Get current geolocation data using Access

is there any way to make to work on OSM system? (OpenStreetsMap) cause its free and good ( or better ) than google maps! thanks you!

Juleehz is offline   Reply With Quote
Old 06-28-2018, 12:17 PM   #4
ridders
Newbee moderator
 
ridders's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 5,562
Thanks: 79
Thanked 1,379 Times in 1,286 Posts
ridders is a jewel in the rough ridders is a jewel in the rough ridders is a jewel in the rough ridders is a jewel in the rough
Re: Get current geolocation data using Access

Quote:
Originally Posted by Juleehz View Post
is there any way to make to work on OSM system? (OpenStreetsMap) cause its free and good ( or better ) than google maps! thanks you!
A good question which I'll look into in the near future.
However I've no experience of working with its API and am not sure how much can be done with it.
Nevertheless, I agree that Open Street Map is very good and not just because it's open source.
I used it in the first version of my UK Postcodes app https://www.access-programmers.co.uk...80&postcount=1
However, later I focused in Google Maps as the documentation is excellent and the prices were at that time very reasonable.
The imminent price rises changes that significantly for medium to large scale use.

Juleehz
If you have worked with the OSM API could you send me a PM or email me using the link below

__________________
Colin
Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left and leave a comment.

New example databases:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


-------------------------
nil illegitimi carborundum est

Last edited by ridders; 06-28-2018 at 11:19 PM.
ridders is offline   Reply With Quote
Reply

Tags
geocoding , geolocation , google map api

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Obtain current geolocation data using VBA ridders Modules & VBA 28 05-28-2018 02:24 PM
Access 2010: Data macro to log current user via TempVars barnacleboy Macros 18 04-28-2014 07:57 AM
Any way to "refresh" SQL tables with current Access table data? sjl SQL Server 3 08-25-2011 02:27 PM
Compare previous row's data to current row's data phoenix81 Queries 4 10-30-2007 09:39 PM
[SOLVED] Data access page (MSODSC Current) question. awetch General 0 11-12-2004 01:20 PM




All times are GMT -8. The time now is 03:55 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Sponsored Links

How to advertise

Media Kit


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World