Results 1 to 2 of 2

Input File into Access

This is a discussion on Input File into Access within the Microsoft Access forums, part of the Question Forums category; The following code gets a report from the web and save the file as htm. I am able to open ...

  1. #1
    New Member
    Join Date
    Oct 2009
    Posts
    11

    Default Input File into Access

    The following code gets a report from the web and save the file as htm.
    I am able to open the report and view de data but I can't import the data into MS Access.
    I check the data using Input into a string variable and it works.
    How can I get the data into an access table instead of into strSQL

    If DownloadFile(sourceUrl, targetFile) Then
    hfile = FreeFile
    Open targetFile For Input As #hfile
    lngChars = LOF(hfile)
    strSQL = Input(lngChars, hfile)

    Close #hfile
    Else

    End If

    Thanks in advance

  2. #2
    MrExcel MVP
    Moderator
    SydneyGeek's Avatar
    Join Date
    Aug 2003
    Location
    Sydney, Australia
    Posts
    11,899

    Default Re: Input File into Access

    One option is to save that file locally and then import the local HTML by running the External Data wizard. HTML and XML are both valid import types.

    Another is to bring Excel into the equation. Create a workbook that pulls the HTML table into a worksheet, then you can refresh the web query and import the updated data, directly or via a link.

    The third is to parse the strSQL and import it.
    How you do that will depend on the format of strSQL; delimiters, line feed characters, whether or not you have column headers.

    Denis
    Self-preservation: For when you've got yourself in a jam
    ------------------------------------------------------
    My site contains a number of Excel and Access Resources

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


DMCA.com