473,383 Members | 2,005 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

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 1640
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.comwrote in message
news:5a**********************************@s13g2000 prd.googlegroups.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*****@localhost.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.comwrote in message
news:5a**********************************@s13g200 0prd.googlegroups.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.com...
On Fri, 18 Jan 2008 19:44:38 GMT, "Larry Linson"
<bo*****@localhost.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
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...
43
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...
7
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
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
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...
12
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: ...
4
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...
1
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.