468,140 Members | 1,423 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,140 developers. It's quick & easy.

Unhandled exception error on Command object

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

Jun 19 '06 #1
0 875

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Professor Frink | last post: by
7 posts views Thread by Chuck Hartman | last post: by
5 posts views Thread by Lucvdv | last post: by
5 posts views Thread by Simon Tamman {Uchiha Jax} | last post: by
1 post views Thread by gcdp | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.