I'm having trouble accessing data from an access database. I'm used to database interactions using asp 3.0. I'm using some code that was provided by "pvb" in this thread:
http://vbforums.com/showthread.php?t...ccess+database

But, none of the data is being displayed on the page. Here is the code as I have implemented it.

I don't get any errors or anything, I just see a blank page when I load it. Shouldn't the data from my database appear in the datagrid when the page is loaded?

Thanks for any help!
VB Code:
  1. Imports System.Data
  2. Imports System.Data.OleDb
  3.  
  4. Public Class WebForm1
  5.     Inherits System.Web.UI.Page
  6.     Protected WithEvents gridAuthors As System.Web.UI.WebControls.DataGrid
  7. #Region " Web Form Designer Generated Code "
  8.  
  9.     'This call is required by the Web Form Designer.
  10.     <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
  11.  
  12.     End Sub
  13.  
  14.     Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
  15.         'CODEGEN: This method call is required by the Web Form Designer
  16.         'Do not modify it using the code editor.
  17.         InitializeComponent()
  18.     End Sub
  19.  
  20. #End Region
  21.  
  22.     Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
  23.         If Not Page.IsPostBack Then
  24.             bindAuthors()
  25.         End If
  26.     End Sub
  27.     Protected Sub bindAuthors()
  28.         Dim mdbPath As String = "G:\WebServer\cpthandler\database\cptDataInfo.mdb"
  29.         Dim connString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & mdbPath
  30.         Dim cn As New OleDbConnection(connString)
  31.         Dim cmdText As String = "SELECT CONTACT_NAME FROM cptDataInfo"
  32.         Dim cmd As New OleDbCommand(cmdText, cn)
  33.         cmd.Connection.Open()
  34.  
  35.         gridAuthors.DataSource = cmd.ExecuteReader(CommandBehavior.CloseConnection)
  36.         gridAuthors.DataBind()
  37.  
  38.     End Sub
  39.  
  40.  
  41. End Class

Here's the html source:
Code:
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="createCPTxml.aspx.vb" Inherits="createCPTxml.WebForm1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
	<HEAD>
		<title>WebForm1</title>
		<meta name="GENERATOR" content="Microsoft Visual Studio.NET 7.0">
		<meta name="CODE_LANGUAGE" content="Visual Basic 7.0">
		<meta name="vs_defaultClientScript" content="JavaScript">
		<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
	</HEAD>
	<body MS_POSITIONING="GridLayout">
		<form runat="server">
			<asp:DataGrid Runat="server" AutoGenerateColumns="True" ID="gridAuthors" />
		</form>
	</body>
</HTML>
I don't get any errors or anything, I just see a blank page when I load it. Shouldn't the data from my database appear in the datagrid when the page is loaded?