473,836 Members | 1,586 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Replacing partial text in an HTML files

I have an HTML file named myHTML.htm

It looks like this:

<great HTML code>
<more great HTML code>
<even more great HTML code>

<insert HTML here>

</great HTML code>
</more great HTML code>
</even more great HTML code>

I need to use my Access database to pull data from a table and insert
it into the HTML file
where it reads: <insert HTML here>

Doable?

Any help is appreciated,
lq
Jan 18 '08 #1
3 1666
It should be doable... the HTML file is a text file, so you can read it with
Access VBA I/O statements, e.g., Input#, just like any other text file, and
write a new file with data merged from the original and your table, with
appropriate statements, e.g., Print#.

The only part that could be tricky is to determine just what records from
your Access table you should retrieve and insert -- my recollection is that
you are a long-time participant here, and know how to retrieve data from
tables with VBA and DAO (or ADO), so I won't offer suggestions on that part.

Larry Linson
Microsoft Access MVP

"Lauren Quantrell" <la************ *@hotmail.comwr ote in message
news:5a******** *************** ***********@s13 g2000prd.google groups.com...
>I have an HTML file named myHTML.htm

It looks like this:

<great HTML code>
<more great HTML code>
<even more great HTML code>

<insert HTML here>

</great HTML code>
</more great HTML code>
</even more great HTML code>

I need to use my Access database to pull data from a table and insert
it into the HTML file
where it reads: <insert HTML here>

Doable?

Any help is appreciated,
lq

Jan 18 '08 #2
On Fri, 18 Jan 2008 19:44:38 GMT, "Larry Linson"
<bo*****@localh ost.notwrote:

You could certainly treat an HTML file as a text file, but you could
do the same with a database file (OK, perhaps as a binary file). The
reason we don't is that there is a better object model available, be
it DAO in the case of an MDB file, or DOM or XML in the case of HTML.

-Tom.

>It should be doable... the HTML file is a text file, so you can read it with
Access VBA I/O statements, e.g., Input#, just like any other text file, and
write a new file with data merged from the original and your table, with
appropriate statements, e.g., Print#.

The only part that could be tricky is to determine just what records from
your Access table you should retrieve and insert -- my recollection is that
you are a long-time participant here, and know how to retrieve data from
tables with VBA and DAO (or ADO), so I won't offer suggestions on that part.

Larry Linson
Microsoft Access MVP

"Lauren Quantrell" <la************ *@hotmail.comwr ote in message
news:5a******* *************** ************@s1 3g2000prd.googl egroups.com...
>>I have an HTML file named myHTML.htm

It looks like this:

<great HTML code>
<more great HTML code>
<even more great HTML code>

<insert HTML here>

</great HTML code>
</more great HTML code>
</even more great HTML code>

I need to use my Access database to pull data from a table and insert
it into the HTML file
where it reads: <insert HTML here>

Doable?

Any help is appreciated,
lq
Jan 19 '08 #3

"Tom van Stiphout" <no************ *@cox.netwrote in message
news:3p******** *************** *********@4ax.c om...
On Fri, 18 Jan 2008 19:44:38 GMT, "Larry Linson"
<bo*****@localh ost.notwrote:

You could certainly treat an HTML file as a text file, but you could
do the same with a database file (OK, perhaps as a binary file). The
reason we don't is that there is a better object model available, be
it DAO in the case of an MDB file, or DOM or XML in the case of HTML.

-Tom.
Well, yes you can use the DOM for XML, but Lauren is not needing to
"interpret" the XML, just replace one line with already-prepared XML, so
appeared to me that treating it as a text file is the simplest way to
accomplish her purpose.

Larry

Jan 19 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
4139
by: Jerry Werner | last post by:
I need to replace my email address on hundreds of web pages with a new address (in a graphic, not a mailto) in order to thwart the email harvesters that spammers are using. Ideally, I'd like to do so while maintaining the same file dates. My web site is currently hosted on a Sun/Solaris/Apache platform. Does anyone know of a reliable way to recursively replace one text string with another, either using unix commands, a proven perl...
43
2687
by: nospam | last post by:
I got three (3) files (1) Untitled.aspx (2) Untitled.aspx.1.cs (3) Untitled.aspx.2.cs These three files must be used together to make file #1, Untitled.aspx, page work via J.I.T. when the User first hits Internet Explorer 6.0 on your browser.
7
1733
by: Rob Meade | last post by:
Hi all, Been a long time since I've been here... /me waves to all.. Ok - my conundrum.. I have a form where a user can enter text and BB codes...for example:
16
2656
by: pawel.pabich | last post by:
Hajo, I would like to have 2 my own partial classes. For example: Default.aspx.cs Default2.aspx.cs and they both will relate to Default.aspx page.
10
2452
by: ptass | last post by:
Hi In asp.net 2.0 an aspx files .cs file is a partial class and all works fine, however, I thought I’d be able to create another class file, call it a partial class and have that compile and load as a 3rd partial class. This would be handy so i can generate standard code into one of the partial classes, while having my custom code untouched
12
5938
by: Adam J. Schaff | last post by:
I am writing a quick program to edit a binary file that contains file paths (amongst other things). If I look at the files in notepad, they look like: <gibberish>file//g:\pathtofile1<gibberish>file//g:\pathtofile2<gibberish> etc. I want to remove the "g:\" from the file paths. I wrote a console app that successfully reads the file and writes a duplicate of it, but fails for some reason to do the "replacing" of the "g:\". The code...
4
7480
by: evgenyg | last post by:
Hello ! We have the following situation - when Ajax request is sent what's being returned by the server is usually an XML (which is used for DOM updates) but sometimes it's HTML which is a whole new page that should replace an existing one. I.e when we issue an Ajax request we don't know what will be returned and analyze the response to act accordingly. Now, the way to replace the current document with a new one used to be easy and...
1
2655
by: TamusJRoyce | last post by:
I have xsl code which I was hoping could be used to replace one specific tag from an xhtml document and output another xhtml document. xsl has phenomenal potential in data replacing, but coming from C/C++ background, it looks like a functional language I'm not familiar with. Here's the link to where I got the code (thanks goes to the author), but I don't have a strong enough background in xsl to tell what is going on. xslfile.xsl ...
0
9826
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9674
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10560
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9389
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7796
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6984
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5831
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4466
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4026
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.