Taras
asked on
From WebSite table to MS Access table
I am scraping a part of text from webpage table that have one row two column in my ms_access table.
I have this part of code.
…….....
...................
' Use native VBA file I/O
tempFile = "D:\tempDate.Html"
Open tempFile For Output As #1
Write #1, tableChunk
Close #1
When I open html “tempDate.html”
Inside that file are value of those two fields:
"
Effective: Oct. 13, 2015 All text in English, small letters.
"
“Effective: Oct. 13, 2015”---- this part is from first column
“All text in English, small letters. “----- this is from second column.
Problem start now here I have next code to move this in my access temp table
' Import the file to a table
DoCmd.TransferText acImportHTML, , "tempMyTempDate", tempFile, True
First time it went through and do transfer , but create an empty table with two fields.
Titles of those two fields are text value that I would like to have in table fields not in their titles.
First filed title is - Effective: Oct. 13, 2015”
and second filed title is - All text in English, small letters.
Next time e.g. on October 14 when I run procedure I got error there is not field with name October 14 2015.
Actually what I need is only date field I do not need other part or other field:” All text in English, small letters”.
I am using this table “TempMyTempDate” is just for storing date which I use to append to another table.
I have this part of code.
…….....
...................
' Use native VBA file I/O
tempFile = "D:\tempDate.Html"
Open tempFile For Output As #1
Write #1, tableChunk
Close #1
When I open html “tempDate.html”
Inside that file are value of those two fields:
"
Effective: Oct. 13, 2015 All text in English, small letters.
"
“Effective: Oct. 13, 2015”---- this part is from first column
“All text in English, small letters. “----- this is from second column.
Problem start now here I have next code to move this in my access temp table
' Import the file to a table
DoCmd.TransferText acImportHTML, , "tempMyTempDate", tempFile, True
First time it went through and do transfer , but create an empty table with two fields.
Titles of those two fields are text value that I would like to have in table fields not in their titles.
First filed title is - Effective: Oct. 13, 2015”
and second filed title is - All text in English, small letters.
Next time e.g. on October 14 when I run procedure I got error there is not field with name October 14 2015.
Actually what I need is only date field I do not need other part or other field:” All text in English, small letters”.
I am using this table “TempMyTempDate” is just for storing date which I use to append to another table.
ASKER
I told you table is one row two columns and I showed you what is in that table and those two columns. Why you askig me that?
I must be unclear.
I must be unclear.
If it is not too much data, then you can probably type information directly into your Access database. If Its just two rows. Import would make sense if there was a whole heap of data...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks a lot
What i would normally is copy online into excel, clean the data, then import