通过 SharePoint ASP.Net GridView 连接到 Access DB

发布于 2024-12-29 13:18:32 字数 981 浏览 1 评论 0原文

我在 SharePoint 网站托管的 ASPX 页面上有一个 ASP.Net GridView 控件。我让 IT 团队将 SharePoint 服务器/服务 Active Directory 组的读/写权限添加到托管 Access MDB 文件的网络驱动器。当我运行该页面时,它仍然显示服务器没有读取数据库的权限。 (我知道数据库并不是专门打开的)。我做错了什么?

这是我的 GridView 代码:

<asp:GridView runat="server" id="GridView1" AutoGenerateColumns="False" DataSourceID="SqlDataSource1">
<Columns>
<asp:boundfield DataField="last_name" HeaderText="last_name" SortExpression="last_name">
</asp:boundfield>
<asp:boundfield DataField="first_name" HeaderText="first_name" SortExpression="first_name">
</asp:boundfield>
</Columns>
</asp:GridView>
<asp:SqlDataSource runat="server" ID="SqlDataSource1" ProviderName="System.Data.OleDb" ConnectionString="Provider=Microsoft.Ace.OLEDB.12.0;Data Source=\\SERVER\sb30$\AccessBase\accessbase.mdb" SelectCommand="SELECT [last_name], [first_name] FROM [BDONAMES]">

这是错误的屏幕截图

I have an ASP.Net GridView control on an ASPX page hosted on a SharePoint site. I got our IT group to add the read/write permissions for SharePoint server/services Active Directory group to the network drive where the Access MDB file is hosted. When I run the page, it still says the server doesn't have permission to read the database. (I know for a fact the DB is not opened exclusively). What am I doing wrong?

Here is my GridView code:

<asp:GridView runat="server" id="GridView1" AutoGenerateColumns="False" DataSourceID="SqlDataSource1">
<Columns>
<asp:boundfield DataField="last_name" HeaderText="last_name" SortExpression="last_name">
</asp:boundfield>
<asp:boundfield DataField="first_name" HeaderText="first_name" SortExpression="first_name">
</asp:boundfield>
</Columns>
</asp:GridView>
<asp:SqlDataSource runat="server" ID="SqlDataSource1" ProviderName="System.Data.OleDb" ConnectionString="Provider=Microsoft.Ace.OLEDB.12.0;Data Source=\\SERVER\sb30$\AccessBase\accessbase.mdb" SelectCommand="SELECT [last_name], [first_name] FROM [BDONAMES]">

Here is a screenshot of the error

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

痴梦一场 2025-01-05 13:18:32

我一直在研究这个问题,不确定 asp.net,但出于安全原因,sharepoint 不会连接到 .mdb 文件。它将连接到新的 2010 版本的访问文件(忘记扩展名)

I have been researching this and not sure about asp.net but sharepoint will not connect to a .mdb file because of security. it will connect to the new 2010 version of an access file (forgot the extension)

吾家有女初长成 2025-01-05 13:18:32

确保用户还具有 MDB 所在目录的创建权限,以便可以创建其锁定 (LDB) 文件。

Make sure the user also has create rights in the directory where the MDB is so it can create its locking (LDB) file.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文