C
Chumley Walrus
I'm trying to do an easy display of a few fields from a MSAccess
database on an aspx page in vb.net, but I get an error at the
"cy.DataSource = Cmd.ExecuteReader()" line :
System.Data.OleDb.OleDbException: IErrorInfo.GetDescription failed with
E_FAIL(0x80004005)
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<%@ Page Language="VB" debug="true"%>
<script language="VB" runat="server">
Sub Page_Load(Src As Object, E As EventArgs)
Dim strConn as string ="Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=e:\web\mydomain\htdocs\db\mydbase.mdb;"
Dim Conn as new OleDbConnection(strConn)
Dim strSQL as string ="SELECT lid,name FROM local"
Dim Cmd as New OleDbCommand(strSQL,Conn)
Conn.Open()
dim cy
cy.DataSource = Cmd.ExecuteReader()
cy.DataBind()
Conn.close()
End Sub
</script>
<html><head>
<title>show-local2</title>
</head>
<form runat="server">
<body bgcolor="#FFFFFF">
<aspataList id="cy" runat="server"
RepeatColumns="1" RepeatDirection="vertical"
CellSpacing="3">
<ItemTemplate><b>
</b> <b><a href=#<%#
String.Format("{0}",Container.DataItem("lid"))%>>
<%# Container.DataItem("name")%>
</a></b> </ItemTemplate>
</ASPatalist>
</form>
</body></html>
????
chumley
database on an aspx page in vb.net, but I get an error at the
"cy.DataSource = Cmd.ExecuteReader()" line :
System.Data.OleDb.OleDbException: IErrorInfo.GetDescription failed with
E_FAIL(0x80004005)
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<%@ Page Language="VB" debug="true"%>
<script language="VB" runat="server">
Sub Page_Load(Src As Object, E As EventArgs)
Dim strConn as string ="Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=e:\web\mydomain\htdocs\db\mydbase.mdb;"
Dim Conn as new OleDbConnection(strConn)
Dim strSQL as string ="SELECT lid,name FROM local"
Dim Cmd as New OleDbCommand(strSQL,Conn)
Conn.Open()
dim cy
cy.DataSource = Cmd.ExecuteReader()
cy.DataBind()
Conn.close()
End Sub
</script>
<html><head>
<title>show-local2</title>
</head>
<form runat="server">
<body bgcolor="#FFFFFF">
<aspataList id="cy" runat="server"
RepeatColumns="1" RepeatDirection="vertical"
CellSpacing="3">
<ItemTemplate><b>
</b> <b><a href=#<%#
String.Format("{0}",Container.DataItem("lid"))%>>
<%# Container.DataItem("name")%>
</a></b> </ItemTemplate>
</ASPatalist>
</form>
</body></html>
????
chumley