Link to home
Create AccountLog in
Avatar of lulu50
lulu50Flag for United States of America

asked on

import data into Access 2003

Hi,

I am working with access 2003.  I have an .mht file that I need to import into my access database.

I manually added my first data in correct field as an example.  but what I want is to have a button to clik on and be able to import what in the .mht file into my correct database field.

Thank you for helping me.
Project.mdb
Abortion.mht
Avatar of Jeffrey Coachman
Jeffrey Coachman
Flag of United States of America image

An mht file is (in most cases) a file that is created when you "Save a web page as..." in Internet Explorer.

It is not really a "Data File" per se.
It is really a file that you can open in a web browser and see a static version of the site.

You will either have to create a Custom routine to "Shape/Transform" this data (possibly Difficult)
Or ask the webmaster of the site if a XML file Download is available.

JeffCoachman
<It is really a file that you can open in a web browser and see a static version of the site.>
Specifically, this file is most likely associated with IE,

Just a note here, I could not open your mht file in IE.
Have you edited this file?

A normal mht file is attached below, I can open this just file in IE.

JeffCoachman
List-of-US-States-in-alphabetica.mht
Ok, I just tested the mht file I just uploaded.
...Actually, it seems that when you post the mht file here it cannot be opened correctly in IE for some reason.

In any event, what I posted above is still valid.
   ...an mht file is not a Data file that can be easily imported into MS Access.

JeffCoachman
Avatar of lulu50

ASKER

boag2000

Thank you for your reply,  This project is very important here where I work and they need this to be in the tables.
what should I do?  
Is there a way to convert the file to something then be able to import the info into the database?

What do you think? doable good idea or no nice try
Avatar of lulu50

ASKER

I saved the same file as .html

Abortion.html
<This project is very important here where I work and they need this to be in the tables.
what should I do? >
Again, this data will need to by "Shaped/Transformed" in order for this to be easy...
This will be a custom project.

If this data is important to your company, then you should have a XML file available for downloading... (or have direct Access to the data in some way)
...In other words, you should not have to resort to creating static web pages to get this "important" data.
Again, talk to the webmaster for this site and discuss the options available.


(FWIW, While viewing the html file I could not really "See" what data would actually go into the Records and fields.)


JeffCoachman
Avatar of lulu50

ASKER

boag2000

I don't have any error now but, I confused on how to put it together

if I do the following I will have a lots of empty spaces between the text in the title.


<cfset searchTerm = "">
        <cfif isDefined("form.BtnQSearch")>
           <cfset searchTerm = trim(FORM.txtQSearch)>
        <cfelseif isDefined("form.BtnAdvSearch")>
           <cfset searchTerm = trim(form.txtAdvSearch)>
        </cfif>
                    
        <cfset ctr = 0>
        <cfloop index="aWord" list="#title#" delimiters=" ,;-.">
           <cfset ctr = ctr + 1>
             <cfif len(searchTerm)>
			<td align="left">#replaceNoCase(aWord, searchTerm, "<span style='background-color:yellow'>#searchTerm#</span>","all")#</td>
             <cfelse>111
               <td align="left">#aWord#</td>
             </cfif>
           <cfif ctr gte 10><cfbreak></cfif>
        </cfloop>

Open in new window

Avatar of lulu50

ASKER

below is the original code and your code
if I put your code in <td and remove my code than I'll have few spaces between the title text.

I am not sure how to combine your code with my code so I can display the correct <td in the correct
place without any empty spaces.


your code:


			 <cfset searchTerm = "">
        <cfif isDefined("form.BtnQSearch")>
           <cfset searchTerm = trim(FORM.txtQSearch)>
        <cfelseif isDefined("form.BtnAdvSearch")>
           <cfset searchTerm = trim(form.txtAdvSearch)>
        </cfif>
                    
        <cfset ctr = 0>
        <cfloop index="aWord" list="#title#" delimiters=" ,;-.">
           <cfset ctr = ctr + 1>
             <cfif len(searchTerm)>
			#replaceNoCase(aWord, searchTerm, "<span style='background-color:yellow'>#searchTerm#</span>","all")#
             <cfelse>111
               #aWord#
             </cfif>
           <cfif ctr gte 10><cfbreak></cfif>
        </cfloop>


My code:

		<cfif listLen(#title#, " ") gt 10>
    				<cfloop index="word" from="1" to="10">
        			<td align="left"><cfoutput>#listGetAt(title, word, " ")# </cfoutput></td>
   	 				</cfloop>
				<cfelse>
    				<td align="left"><cfoutput>#title#</cfoutput></td>
				</cfif> 

so, I tried to remove my code and do this: 
but I get empty spaces in the title text. 


<cfset searchTerm = "">
        <cfif isDefined("form.BtnQSearch")>
           <cfset searchTerm = trim(FORM.txtQSearch)>
        <cfelseif isDefined("form.BtnAdvSearch")>
           <cfset searchTerm = trim(form.txtAdvSearch)>
        </cfif>
                    
        <cfset ctr = 0>
        <cfloop index="aWord" list="#title#" delimiters=" ,;-.">
           <cfset ctr = ctr + 1>
             <cfif len(searchTerm)>
			<td align="left">#replaceNoCase(aWord, searchTerm, "<span style='background-color:yellow'>#searchTerm#</span>","all")#</td>
             <cfelse>111
               <td align="left">#aWord#</td>
             </cfif>
           <cfif ctr gte 10><cfbreak></cfif>
        </cfloop>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Jeffrey Coachman
Jeffrey Coachman
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of lulu50

ASKER

ok
lulu50

Just so you know I wasn't trying to sound "Crabby".
;-)

My feeling is that if this data is important to your company, you should have some level of direct access to the data.
...either through a utility to download the data, or some form of a "Link".

Sometimes all it takes is a phone call the webmaster to request this functionality...

;-)

Jeff