[AccessD] Import data from web site into Access

Foote, Chris Chris.Foote at uk.thalesgroup.com
Thu Jun 5 02:33:20 CDT 2008


Many thanks Gustav!

Found in in my archives - it was mid December 2006 not last year.

Thanks again for the lead!

Regards
Chris F

> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Gustav Brock
> Sent: Wednesday, June 04, 2008 12:46 PM
> To: accessd at databaseadvisors.com
> Subject: Re: [AccessD] Import data from web site into Access
> 
> 
> Hi Chris
> 
> It could have been the thread "pull data from web page" from 
> mid December last year.
> 
> Or, to download a page or a file:
> 
> <code>
> Private Declare Function URLDownloadToFile Lib "urlmon" Alias 
> "URLDownloadToFileA" ( _
>   ByVal pCaller As Long, _
>   ByVal szURL As String, _
>   ByVal szFileName As String, _
>   ByVal dwReserved As Long, _
>   ByVal lpfnCB As Long) _
>   As Long
> 
> Public Function DownloadFile( _
>   ByVal strURL As String, _
>   ByVal strLocalFilename As String) _
>   As Long
>   
> ' Download file or page with public access from the web.
> ' 2004-12-17. Cactus Data ApS, CPH.
> 
> ' Usage, download a file:
> ' lngRet = 
> DownloadFile("http://www.databaseadvisors.com/Graphics/conf200
> 2/2002ConferencePicsbySmolin/images/dba02smolin27.jpg", 
> "c:\happybassett.jpg")
> '
> ' Usage, download a page:
> ' lngRet = 
> DownloadFile("http://www.databaseadvisors.com/conf2002/conf200
> 202.asp", "c:\dbaconference.htm")
> 
> ' Returns 0 if success, error code if not.
> ' Error codes:
> ' -2146697210 "file not found".
> ' -2146697211 "domain not found".
> 
> ' Limitation.
> ' Does not check if local file was created successfully.
> 
>   Dim lngRetVal As Long
>     
>   lngRetVal = URLDownloadToFile(0, strURL & vbNullChar, 
> strLocalFilename & vbNullChar, 0, 0)
>   
>   DownloadFile = lngRetVal
>   
> End Function
> </code>
> 
> You are not telling what to download, but remember that 
> Access can directly attach a table in a downloaded HTML file.
> 
> /gustav
> 
> 
> >>> Chris.Foote at uk.thalesgroup.com 04-06-2008 12:17 >>>
> 
> Good day/evening/night all!
> 
> One of my work mates is trying to import data from a web page 
> into Access.
> 
> Excel has a function called Web Query that can extract data 
> from a specific
> place in a web page. I've found a discussion on tek-tips
> (<http://www.tek-tips.com/viewthread.cfm?qid=1249526&page=1>) 
> that shows how
> to import a Web Query from an external Excel file into 
> Access, but is it
> possible to do this directly.
> 
> I vaguely remember somebody on the list was getting exchange 
> rate data(?)
> from an external website for use in Access - but I cannot 
> remember who,
> what, or when ;-(
> 
> TIA!
> 
> Chris Foote
> -- 
> 
> 
> 
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 



More information about the AccessD mailing list