internet data

  • Thread starter Thread starter Joost
  • Start date Start date
J

Joost

Hi,

I have a msaccess databases which i like to update with external data from a
internetpage.
How can this be done

thanks anyway
 
It is not obvious.
But here is one way:

Sub LinkHTML()
Dim dbs As Database
Dim tdfHTML As TableDef
Dim rstSales As Recordset

' Open the Microsoft Access database.
Set dbs = CurrentDb

' Create a TableDef object.
Set tdfHTML = dbs.CreateTableDef("CategoriesHTMLTable")

' Set the connection string to specify the source database type and
' the full path to the file that contains the table you want to link.
tdfHTML.Connect = "HTML Import;" _
& "DATABASE=http://home/pnetsql/categories.html"
'http://www.federalreserve.gov/releases/h15/update/"

' Set the SourceTableName property to the name of the table you want to
access.
tdfHTML.SourceTableName = "Categories"
'tdfHTML.SourceTableName = "Table1"

' Append the TableDef object to the TableDefs collection to create a
link.
dbs.TableDefs.Append tdfHTML

' Create a Recordset object from the linked HTML table.
'Set rstSales = dbs.OpenRecordset("CategoriesHTMLTable")
End Sub
 
Back
Top