How do I create HTM documents Using an MS Access DB

Jeff444

Member
Aug 21, 2000
136
0
0
Although I am very good with creating Access databases I am having trouble creating HTM's that are Access Driven.
 

Train

Lifer
Jun 22, 2000
13,861
68
91
www.bing.com
Heres the ASP route (Access can output HTML pages, but they are nasty, this is better)

1) set up your access db as a system DSN in control panel
2) enable Personal Web Server if you are on WIn9x or IIS if you are on NT or Win2k
3) Create an ASP page (just like html, except with asp extension)
4)Open a database connection in the ASP page: (use your Access DSN)


<<
<%
Dim ADOConn
Set ADOConn = Server.CreateObject(&quot;Adodb.Connection&quot;)
ADOConn.Open &quot;DSN=MyAccessDSN&quot;
>>


5) create a recordset in the asp page: (use the connection above and any query you want)


<<
<%
Dim rs
Set rs = Server.CreateObject(&quot;Adodb.Recordset&quot;)
rs.Open &quot;Select FirstName, LastName From tblPeople&quot; , ADOConn
>>


6) loop thru the recorset until its at the end, display a line of HTML for each.


<<
While Not rs.EOF
%>
Employee Name : <%=rs(&quot;FirstName&quot;) &amp; &quot; &quot; &amp; rs(&quot;LastName&quot;) %> <br>
<%
rs.MoveNext
Wend
%>
>>




http://msdn.microsoft.com - A good place to pick up some easy asp
http://www.aspin.com - a good place for all kinds of ASP stuff