通过 SharePoint ASP.Net GridView 连接到 Access DB
我在 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]">
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我一直在研究这个问题,不确定 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)
确保用户还具有 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.