文件绝对存在:
_______________________________________________________________
<%@ import namespace="system.data" %>
<%@ import namespace="system.data.oledb" %>
<script language="vb" runat="server">
sub page_load(sender as object,e as eventargs)
if page.ispostback=false then
call binddata()
end if
end sub
sub mydatagrid_edit(sender as object,e as datagridcommandeventargs)
mydatagrid.edititemindex=cint(e.item.itemindex)
call binddata()
end sub
sub mydatagrid_cancel(sender as object,e as datagridcommandeventargs)
mydatagrid.edititemindex=-1
call binddata()
end sub
sub mydatagrid_update(sender as object,e as datagridcommandeventargs)
dim conn as new oledbconnection(" provider=microsoft.jet.oledb.4.0;data source= " & server.mappath("../wwwlink"))
dim sitenametext,urltext,gradetext,introtext as textbox
sitenametext=e.item.cells(2).controls(0)
urltext=e.item.cells(3).controls(0)
introtext=e.item.cells(4).controls(0)
gradetext=e.item.cells(5).controls(0)
dim sql as string
sql="update wwwlink set sitename='" & sitenametext.text & "' url='" & urltext.text & "' intro='"& introtext.text & "' grade='"& gradetext.text & "'"
dim cmd as new oledbcommand(sql,conn)
conn.open()
cmd.executenonquery()
conn.close()
mydatagrid.edititemindex=-1
call binddata()
end sub
sub binddata()
dim conn as new oledbconnection("provider=microsoft.jet.oledb.4.0; data source=" & server.mappath("../wwwlink"))
dim cmd as new oledbcommand("select * from wwwlink",conn)
dim adp as new oledbdataadapter(cmd)
dim ds as new dataset
adp.fill(ds,"link")
mydatagrid.datasource=ds.tables("link").defaultview
mydatagrid.databind()
end sub
</script>
<html>
<body>
<form runat="server">
<ASP:datagrid id="mydatagrid" headerstyle-backcolor="red" width="95%" oneditcommand="mydatagrid_edit" oncancelcommand="mydatagrid_cancel" onupdatecommand="mydatagrid_update" datakeyfield="sitename" runat="server" >
<columns>
<asp:editcommandcolumn edittext="编辑" updatetext="更新" canceltext="取消" itemstyle-wrap="false" runat="server"/>
</columns>
</ASP:datagrid>
</form>
</body>
</html>
________________________________________________________________________
错误描述:找不到文件 'c:\inetpub\wwwroot\asp.net\wwwlink'。
细节:Exception Details: System.Data.OleDb.OleDbException: 找不到文件 'c:\inetpub\wwwroot\asp.net\wwwlink'。
[此贴子已经被作者于2007-3-27 8:32:58编辑过]