htmlencode in access 2000?

A

Alain Bourgeois

Dear all,


I have a (non-web) access application with tables.
I have to generate a (complicated) report combining several tables one
after another.
To do this, I would like to use VBA to generate an HTML file which could
be opened/printed with internet explorer.

Is there an htmlencode function in a windows dll I could call in access
or do I have to write my own?

Regards,
Alain
 
A

Albert D. Kallal

Just build the report in ms-access.

Ms-access can then save/export the report as html.

Just launch a report now, and then go file->export...there is a option to
export as HTML....

You running quite a old version of ms-access, and in 2000, the internet was
just really starting to be adopted (I was on dial up modem back then).
However, even back then, a2000 did HTML export built in for reports.

Just keep the graphics to min, and also be quite careful (generous) with
spacing between things.
 
G

Guest

XML can be opened/printed with internet explorer.
Make a table or query and export the data as XML.

(david)
 
A

Alain Bourgeois

I want to generate html through multiple ditinct queries, one after each
other.
It is not based on a simple query/table and cannot be done on a report.
(And I keep access 2000 as many users still use it).
 
A

Alain Bourgeois

I want to generate html through multiple ditinct queries, one after each
other.
The html to generate is
--------------------------
query1 content
....
....
stats

page break

query 2 contents
....
....
stats

page break

query 3 contents
.....
.....
stats

Global stats (sums, etc)
---------------------

Query 1/2/3 are based on different fields and have a totally different
structure.

This cannot be done with a report.

I want to generate an html or xml file, please anwer the question about
htmlencode instead of telling me to use another way which does not suit
what I want to do, or don't answer.

Regards.
 
A

Albert D. Kallal

Alain Bourgeois said:
I want to generate html through multiple ditinct queries, one after each
other.
It is not based on a simple query/table and cannot be done on a report.
(And I keep access 2000 as many users still use it).

Oh, no nothing wrong with a2000 being old, I just poitnign out that it is
quite amaing that even back then ms-access had html output abilites. I
was commetiong on the fact that your using a old verson, but in fact how
amzing it is that back then, it had html output abilites.

So, just keep in mind that you can export your quieres as html, or eport
your forms as html output also.

The access report writer is the about the most flexible report
writer I seen. I written fixed reports that print to dot matrix primers to
exact positions that fill out forms. I also built reports that printout
complex calendars that look much like outlook.

In fact, I can't think of ANY kind of output and report that the access
report writer has not been able to make for me.

If you need to output 5 diffent queries, then just drop in 5 sub-reports
based on those 5 queries into one main report. Each report can be different
format, and different tables.

However, if as you mentioned, you can't build your report in ms-access, then
your requirements are very special indeed, and it will likely take fairly
large
teams of experienced developers to meet your requirements .

In my experience , not even the corporate edition of a sql server reporting
services can produce the reports that one can build in ms-access.
When you throw in the abiliy of reprots to have VBA included in them, then
you have quite an amazing report writer.

Unfortunately, if you can't build your reports and outputs in MS access, or
simply export the queries as HTML (both of which a2000 can do) then my
spider sense tells me that you're using the wrong tool in the first place,
and I don't think ms-access is the right tool here...
 
A

Alain Bourgeois

All datas and code is already in ms-access.
The only thing I need is writing html file.
Access allows me to output a text file, I just need the function to
convert a text value in html (replacing < with &lt;, > with &gt;, é with
&eacute;, etc).
This function exists in asp or .net. Is this function available in a dll
I could use in the references?
 
A

Albert D. Kallal

Alain Bourgeois said:
All datas and code is already in ms-access.
The only thing I need is writing html file.
Access allows me to output a text file, I just need the function to
convert a text value in html (replacing < with &lt;, > with &gt;, é with
&eacute;, etc).

Ah, ok. This might not be so bad then...

Do note that access does allow output and exporting of data in HTML format.

So, you can export a query as HTML in place of just plain text.

Have you looked at exporting the query as a HTML file, and then perhaps
processing that output of HTML further? (this suggestion might not be any
use to you, but I'm just suggesting you consider it, since it could wind up
saving a lot of work )

It really depends on what kind of formatting your looking for terms of the
HTML, but ms-access can export data as HTML.

so, maybe sent it out as HTML, and then reprocessed the output file using
string replacements on it.

I think if you only have about 5-12 replacements for characters, then check
out replace() command in the help files.

Hence you can always take the data from a query in code, and then
open a text file for output. You thus output the text file one
line at a time, but do the replacements before you write the record
data out.

If you don't have two many replacements to do, then I think this is workable
in ms-access code.

Do you have code now that builds the output text files, or have you been
using the built in text export features?

I can post a couple of simple loops that show you how to open a text file
and output data from a query. (perhaps that's might be what you doing
now? -- if your doing this now, then using the replace() might help you
here).
 
A

Alain Bourgeois

Albert,

I already wrote the code exporting a recordset to an html text file, I
don't need it nor help to do that.

My only question was: if I have a string (e.g. "if ... => ..."), is
there a way to use the htmlencode function converting it (e.g. "if ...
=&gt; ...") (by adding a reference in vba or pasting the existing vb
code) or do I have to write my own?
 
G

Guest

Since you ask, you can get a HTMLencode function in
Access using exactly the same object you use in ASP.

Of course, that would be stupid.

I can understand why you might think that a HTMLencode
function exists in ASP, but not understanding that means
that you are really starting a long way back.
and cannot be done on a report.

Clearly, you know even less about Access than you do
about ASP.

There is a whole World Wide Web out there. Google
is your friend.

(david)
 
A

Albert D. Kallal

My only question was: if I have a string (e.g. "if ... => ..."), is
there a way to use the htmlencode function converting it (e.g. "if ...
=&gt; ...") (by adding a reference in vba or pasting the existing vb
code) or do I have to write my own?

Yes, you have to roll your own.......
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top