Is it possible to view Access 2007 tables from a share point web part

turtlkky

New member
Local time
Yesterday, 23:02
Joined
Jun 4, 2010
Messages
2
I am trying to figure out if there is a way where I could view a table from an access 2007 database located on a unc path the sharepoint server has access to and get it to show up in a web part (content editor web part) in SharePoint? Below is what I have tried and not successfull. At first I thought it may have been due to my type connection. Im still not sure if it is. I am trying to create a DSN-Less connection from the SharePoint server web page to the Access database on the network. Am I close, or is this even possible?
The database name is: Testdb.accdb
Contains one table: TestTbl
TestTbl contains two fields/columns: TestField and TestField2
There are 10 rows/records with data in the fields
SharePoint 2007 Enterprise

Code:
<%@ Language="Vbscript" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Link Test to Access 2007 DB</title>
</head>
<body>
<%
Dim cnnSimple 'ADO connection
Dim rstSimple 'ADO recordset
Set cnnSimple = New ADODB.Connection
cnnSimple.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data Source="[URL="file://\\svr1\public\ar\ms"]\\svr1\public\ar\ms[/URL] reg\all digl\TestDB.accdb"; Persist Security Info=False;"
set rstSimple = cnnSimple.Execute("SELECT TestField FROM TestTbl")
%>
<P> Connecting to Access with Ole connection </P>
<table border="1">
<%
Do While Not rstSimple.EOF
%>
<tr>
 <td><%= rstSimple.Fields(0).Value %></td>
</tr>
<%
rstSimple.MoveNext
Loop
%>
</table>
<%
rstSimple.Close
Set rstSimple = Nothing
cnnSimple.Close
Set cnnSimple = Nothing
%>
</body>
</html>
 
No clue about that technique. Would creating a table link in an Access database to a SharePoint List or vice versa give you want you want?
 
What I originally wanted to do was move the access database to sharepoint. But corporate has the file limit restricted and would not grant approval for moving the access db to sharepoint. So what I was wanting to do is create a link in sharepoint that would be able to display a table from access within sharepoint. I am familiar with sharepoint lists. But to my knowledge, you have to export the table from access to sharepoint. Now access, I know, has the capability to view a sharepoint list. I am trying to create a link the other way around. Have a List in sharepoint that views an access table.

I perform updates to the access database daily and it would be handy if I could have others be able to view the tables I update in access from sharepoint.

I know sharepoint has the capability to view SQL databases and such when using .asp. I am trying to do something similar but view access database tables.
 
What is the difference? You can have a sharepoint list linked to an Access table or link an Access table to a sharepoint list. It is the same thing. Design edits will not auto show up on either side. You will have to delete one side and relink if you make any design changes.
 

Users who are viewing this thread

Back
Top Bottom