adamdavies
Programmer
im using windows xp.
ive set up a new virtual directory through computer manager, service and applications, internet info service, web sites, new virtual directory.
Alias - BegASPNETdb
Directory - c:\BegASPNETdb\webroot
From an example in asp.net book, i created another folder called ch03. In here ive created a .aspx file
<%@ Import namespace="System.Data" %>
<%@ Import namespace="System.Data.OleDb" %>
<html>
<head>
<title>Access DB</title>
</head>
<body>
<h3>Access DB</h3>
<asp:dataGrid id="dgSuppliers" runat="server"/>
<body>
</html>
<script language="VB" runat="server">
Sub Page_Load(Source As Object, E As EventArgs)
Dim strConnection As String = "Provider=Microsoft.Jet.OleDb.4.0;"& _
"data source=C:\BegASPNETdb\datastores\nwind.mdb;"
Dim objConnection As New OleDbConnection(strConnection)
Dim strSQL As String = "SELECT * FROM Suppliers;"
Dim objCommand As New OleDbCommand(strSQL, objConnection)
objConnection.Open()
dgSuppliers.DataSource = objCommand.ExecuteReader()
dgSuppliers.DataBind()
objConnection.Close()
End Sub
</script>
i placed the nwind.mdb database in another folder called datastores.
I run all i get up is the heading Access DB.
Does anybody know where i am going wrong and why i cant view the contents of the table suppliers in the nwind db.
I also tried with msde and set up the services, this also did not work for me.
thanks
adam
ive set up a new virtual directory through computer manager, service and applications, internet info service, web sites, new virtual directory.
Alias - BegASPNETdb
Directory - c:\BegASPNETdb\webroot
From an example in asp.net book, i created another folder called ch03. In here ive created a .aspx file
<%@ Import namespace="System.Data" %>
<%@ Import namespace="System.Data.OleDb" %>
<html>
<head>
<title>Access DB</title>
</head>
<body>
<h3>Access DB</h3>
<asp:dataGrid id="dgSuppliers" runat="server"/>
<body>
</html>
<script language="VB" runat="server">
Sub Page_Load(Source As Object, E As EventArgs)
Dim strConnection As String = "Provider=Microsoft.Jet.OleDb.4.0;"& _
"data source=C:\BegASPNETdb\datastores\nwind.mdb;"
Dim objConnection As New OleDbConnection(strConnection)
Dim strSQL As String = "SELECT * FROM Suppliers;"
Dim objCommand As New OleDbCommand(strSQL, objConnection)
objConnection.Open()
dgSuppliers.DataSource = objCommand.ExecuteReader()
dgSuppliers.DataBind()
objConnection.Close()
End Sub
</script>
i placed the nwind.mdb database in another folder called datastores.
I run all i get up is the heading Access DB.
Does anybody know where i am going wrong and why i cant view the contents of the table suppliers in the nwind db.
I also tried with msde and set up the services, this also did not work for me.
thanks
adam