Hi there,
I'm currently working on an application which lists all of the contents of a specific table within my Access database. The database connection is correct, the table names required are correct as well as the IDs involved...so why is it displaying nothing?
Below is my entire code for that particular page. To see a live version, please see this link: http://www.psychobeing.co.uk/soft131/people/
Code:<script language="VB" runat="server"> Sub Page_Load() Const cs = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=People.mdb;" Dim rs As Object Dim s As String Dim color As String rs = CreateObject("ADODB.Recordset") rs.Open("Person", cs) s = "<table border='1' cellpadding='3' cellspacing='3'>" Do Until rs.EOF() s = s & "<tr><td>" & rs.Fields("Surname").Value & "</td>" s = s & "<td>" & rs.Fields("Phone").Value & "</td>" If rs.Fields("Gender").Value = "Male" Then color = "blue" Else color = "red" End If s = s & "<td style='color:" & color & ";'>" & rs.Fields("Gender").Value & "</td></tr>" rs.MoveNext() Loop s = s & "</table>" parData.InnerHtml = s rs.Close() rs = Nothing End Sub </script> <html> <head> <title>People V1</title> </head> <body> <p id="parData" runat="server"></p> </body> </html>




Bookmarks