Byrd25
10-11-2004, 11:55 PM
So far I can get IE to see the heading but I can't get it to read the database and then output into the Table that I created what am I doing wrong. I have looked at many books and I saw a code just like this one in one of the books and it's not working. Please help!!!! :confused:
<PRE class=code><HTML>
<HEAD><TITLE>A Simple First Page</TITLE>
<SCRIPT LANGUAGE="VBScript">
<%
Dim myConnection
Dim strConnect
strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source= C:\Documents and Settings\default\My Documents\FooBar.mdb"
Set myConnection = CreateObject ("ADODB.Connection")
myConnection.Open strConnect
Set RS = CreateObject ("ADODB.Recordset")
RS.Open("Select * from tblFoo")
%>
</SCRIPT>
</HEAD>
<BODY>
</pre>
<TABLE align = center COLSPAN=8 CELLPADDING=5 Border=0 width=200><br>
<TR><TD VALIGN = TOP BGCOLOR ="#8000000" <FONT STYLE = "ARIAL NARROW" COLOR = "#ffffff"
size=2>id </font></td>
<TD VALIGN = TOP BGCOLOR ="#8000000"<FONT STYLE = "ARIAL NARROW" COLOR = "#ffffff"
size=2>fldMyVals </font></td>
<%
do while not RS.EOF %><TR>
<td bgcolor = "#8000000" ><font style = "arial narrow" size=2> <% RS ("id")%> </font><td>
<td align = center> <% RS ("fldMyVals") %> </td> </tr>
<% RS.MoveNext %>
<% Loop %>
</table>
</body>
</HTML>
<PRE class=code><HTML>
<HEAD><TITLE>A Simple First Page</TITLE>
<SCRIPT LANGUAGE="VBScript">
<%
Dim myConnection
Dim strConnect
strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source= C:\Documents and Settings\default\My Documents\FooBar.mdb"
Set myConnection = CreateObject ("ADODB.Connection")
myConnection.Open strConnect
Set RS = CreateObject ("ADODB.Recordset")
RS.Open("Select * from tblFoo")
%>
</SCRIPT>
</HEAD>
<BODY>
</pre>
<TABLE align = center COLSPAN=8 CELLPADDING=5 Border=0 width=200><br>
<TR><TD VALIGN = TOP BGCOLOR ="#8000000" <FONT STYLE = "ARIAL NARROW" COLOR = "#ffffff"
size=2>id </font></td>
<TD VALIGN = TOP BGCOLOR ="#8000000"<FONT STYLE = "ARIAL NARROW" COLOR = "#ffffff"
size=2>fldMyVals </font></td>
<%
do while not RS.EOF %><TR>
<td bgcolor = "#8000000" ><font style = "arial narrow" size=2> <% RS ("id")%> </font><td>
<td align = center> <% RS ("fldMyVals") %> </td> </tr>
<% RS.MoveNext %>
<% Loop %>
</table>
</body>
</HTML>