We help IT Professionals succeed at work.
Get Started

HTML table linked to Access Base

Matt_Kennedy
Matt_Kennedy asked
on
330 Views
Last Modified: 2012-05-12
I am trying to build an html page that displays fields from an ACCESS 2003 database in a table.  For some reason the fields do not come up when the html page is executed.  The SQL query looks at the database and is suppose to return all rows that begin with the letter R,  Instead it returns a blank table.  Can someone please look at the code and see where the mistakes lay? The code is below:

<html>
      <head>
      <title>Brand Select</title>
      </head>
      <body>

      <%
      ' Database connection - remember to specify the path to your database

      'DIM Conn
      Set Conn = Server.CreateObject("ADODB.Connection")
      DIM ConnectString
      Set ConnectString="Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=\\anderson\company\BrandSource\Brands.mdb"
      Conn.Open ConnectString
      Set RSTitleList = Server.CreateObject("ADODB.Recordset")
      ' SQL Query
      'DIM strSQL
      SET strSQL = "SELECT * FROM Brands WHERE (((Brands.BrandName) Like 'R*'))"
      Set RSTitleList =  Conn.Execute(strSQL)
      ' Execute the query (the recordset rs contains the result)
%>
<TABLE align=center COLSPAN=8 CELLPADDING=5 BORDER=0 WIDTH=200>

<!-- Begin our column header row -->  
<TR>
   <TD  VALIGN=TOP BGCOLOR="#800000">
     <FONT STYLE="ARIAL NARROW" COLOR="#ffffff" SIZE=2> Brand Name</FONT>
   </TD>
    <TD ALIGN=CENTER BGCOLOR="#800000">
     <FONT STYLE="ARIAL NARROW" COLOR="#ffffff" SIZE=2>      SubBrand</FONT>
   </TD>
   <TD ALIGN=CENTER BGCOLOR="#800000">
     <FONT STYLE="ARIAL NARROW" COLOR="#ffffff" SIZE=2>      Manufacture</FONT>
   </TD>
   <TD ALIGN=CENTER BGCOLOR="#800000">
     <FONT STYLE="ARIAL NARROW" COLOR="#ffffff" SIZE=2>      Handle</FONT>
   </TD>
   <TD ALIGN=CENTER BGCOLOR="#800000">
     <FONT STYLE="ARIAL NARROW" COLOR="#ffffff" SIZE=2>      Website</FONT>
   </TD>
</TR>

<!-- Ok, let's get our data now -->
<% do while not RStitleList.EOF %>
<TR>
   <TD BGcolor ="f7efde" align=center><font style ="arial narrow" size=2>
           <%=RStitleList("BrandName")%></font>   </TD>
   <TD BGcolor ="f7efde" align=center><font style ="arial narrow" size=2>
          <%=RSTitleList("SubBrand")%>   </font>   </TD>  
   <TD BGcolor ="f7efde" align=center><font style ="arial narrow" size=2>
          <%=RSTitleList("Manufacture")%>   </font>   </TD>
   <TD BGcolor ="f7efde" align=center><font style ="arial narrow" size=2>
          <%=RSTitleList("Handle")%>   </font>   </TD>
   <TD BGcolor ="f7efde" align=center><font style ="arial narrow" size=2>
          <%=RSTitleList("Website") %>   </font>   </TD>
</TR>

   <% RSTitleList.MoveNext%>
<%loop %>      
      <% Conn.Close
      Set Conn = Nothing%>

      </body>
      </html>
      
thank you in advance!
Comment
Watch Question
Programmer-analyst
Commented:
This problem has been solved!
Unlock 1 Answer and 13 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE