Unhandled exception error on Command object

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">
<asp:DataList 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>
</ASP:Datalist>
</form>
</body></html>


????
chumley
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top