Importing data from the web

A

Andro Dgebuadze

Hi

I know how to import data from web to Excel (External Data import, Web
Queries), but how to link my table to htnl? For exampl I need to link my
Journal Table to the Currency Rate Table given on the web.

Andro
 
J

Joe Fallon

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/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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top