• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 102
  • Last Modified:

Web enabled Access Database

Hello Everyone,
   I have a Microsoft Access database that I had someone code a page to make it web accessible.  However, when I put it on my Win 2012 R2 web server, I get an internal error 500.

500 - Internal server error.
There is a problem with the resource you are looking for, and it cannot be displayed.

The path to the DB is set properly, I set up the ODBC connection on the server and ASP is working fine.

Any guidance on what might be wrong?  Maybe a reminder check list for having web enabled Access DBs?  I haven't done this in years.. .my memory might not be great, and maybe 2012 has different requirements...?

Thanks!
0
Cedar Crest College
Asked:
Cedar Crest College
  • 7
  • 3
  • 2
  • +2
1 Solution
 
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
what you're seeing is the generic "friendly" IIS message. This message is displayed so not to confuse users with technical related issues. What you want to do is go into IIS and configure the actual errors to be displayed:

In IIS, go to your website, double click the ASP icon, go to DEBUG, and set "Send Errors to Browser" to true. Reload the page and you should get a more descriptive error message.
0
 
ManjuIT - Project ManagerCommented:
Did you check the compatibility in access database?
0
 
Cedar Crest CollegeAuthor Commented:
@BigMonty: So... attached is a screenshot of that web server's settings -- and the error did not change.  I did not get the verbose error.Capture.PNG
I did stop and restart web services, too.

Thoughts?

@Manju: Can you be more specific about checking for compatibility?  What am I checking with for compatibility?
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
ManjuIT - Project ManagerCommented:
2 things, 1. check the authentication settings in IIS & compare it with your previous deployment. and 2. go to your access db path, open the access file, go to Publish option & run compatibility check
0
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
I've never heard of a Compatibility Check for Access, and 2016 does not have a Publish option. If you're referring to this article:

https://support.office.com/en-us/article/Check-file-compatibility-with-earlier-versions-d9856881-5875-4c58-915f-06859b2943a7

That applies to other Office products, but not Access.

As BigMonty said, this is an IIS issue, not a Microsoft Access issue. About the only thing you can do from the Access side of things is Compact the database. How you do that depends on the version of Access you have, but in 2016 you click the Info item and click Compact & Repair.

Is the Access database on the same physical network as the web server? You can't get to an Access database remotely, so it must be on the same physical network.

Also, note that you're not actually working with Access, but rather an ACE or JET database. Those are the file server database formats commonly used with Access. I know this is somewhat nit-picky, but it helps to understand the differences. You can run an ACE or JET database without Access installed. All you need are the correct drivers.
0
 
Cedar Crest CollegeAuthor Commented:
Hi @Scott McDaniel - the Access database is in the same directory as the ASP page that is trying to access it.  I believe that you and @BigMonty are on the right trail, but I don't know how to resolve that issue.  I guess the question might be: what driver do I need -- and where do I get it?
0
 
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
could you post a screenshot of the error you're getting? Are you using IE or Chrome?
0
 
Cedar Crest CollegeAuthor Commented:
Here you go...

This error is in Chrome, but IE, Edge and Firefox show the same error.Capture01.PNG
0
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Are you using a JET (.mdb) or ACE (.accdb) file?

If you're using Jet, then I don't know that you have to install any drivers. Except for the newest Windows Server OS systems, you should have the drivers necessary to use them.

If you're using ACE, then you usually have to install one of these:

https://www.microsoft.com/en-us/download/details.aspx?id=23734

https://www.microsoft.com/en-us/download/details.aspx?id=13255 (2010)
https://www.microsoft.com/en-us/download/details.aspx?id=54920 (2016)
0
 
Cedar Crest CollegeAuthor Commented:
@Scott - it is a MDB file -- so that's Jet.  Probably created in Access 2010, I am guessing.
0
 
Cedar Crest CollegeAuthor Commented:
Here is the ASP if it helps...?
<%
'code to check the records from database
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
'need to change the path of file of your server
conn.Open "c:/inetpub/wwwroot/directory/directory.mdb"
set rs = Server.CreateObject("ADODB.recordset")
'check value is empty or not
If Request.form("productSelect")="" then
search=Request.Form("txtSearch")
rs.Open "SELECT FirstName,LastName,Dept,Title,Office,Ext,Email FROM Employee WHERE LastName LIKE '" & search & "' ",conn
Else
dept=Request.form("productSelect")
dept=Replace(dept, "'", "")
rs.Open "SELECT FirstName,LastName,Dept,Title,Office,Ext,Email FROM Employee WHERE Dept LIKE '" & dept & "'",conn
End If

'end of code
'search on the basis of department
'Declare a variable to store the query to be excuted. Here we are using a hardcoded query.We can also use a stored procedure  
set rsQuery = Server.CreateObject("ADODB.recordset")
    rsQuery.Open "select distinct Dept,Dept from Employee order by Dept asc",conn   
     'Declare the array  
    Dim arrProducts   
    
    if not rsQuery.EOF then    
          arrProducts = rsQuery.GetRows()  ' Convert recordset to 2D Array  
    end if   
      
   'Close the Connection and recordset    
    
    rsQuery.Close  

	'Declare a function to set the selected text     
    Function selectProduct(vProduct)      
      if vProduct = product then      
          'Response.Write("selected=""selected""")           
     end if      
    End Function 
%>
<html><head>
<meta http-equiv="content-type" content="text/html; charset=windows-1252">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<!--custom css part start here-->
	<style>
	.custab{
    border: 1px solid #ccc;
    padding: 5px;
    margin: 1% 0;
    box-shadow: 3px 3px 2px #ccc;
    transition: 0.5s;
    }
.custab:hover{
    box-shadow: 3px 3px 0px transparent;
    transition: 0.5s;
    }
		
		th{
			background: #ffcc33;
			color:#800000; 
		}	
		
	</style>
	
	<!--end of custom css-->
	</head>
	
	
	<body>

		<div class="container">
	<div class="row">
		<div class="col-lg-6">
		
	  <h2>Search Results:</h2>
  	  
  <form action="access.asp" method="post">
		
           <div id="custom-search-input">
                            <div class="input-group col-md-12">
								<input placeholder="Search by Last Name" name="txtSearch"  value="<%=search%>" type="text" class="search-query form-control input-lg">
						
                                <span class="input-group-btn">
                                    <button class="btn btn-danger btn-lg" type="submit">
                                        Go
                                    </button>
                                </span>

                            </div>
                        </div>
						<br/>
						<div id="custom-search-input">

						<div class="input-group col-md-12">
						
								
								<select name="productSelect" id="productSelect" class="search-query form-control input-lg"> 
								<option value="">Select Department </option> 
  <%    
      'Check whether it's a proper array or not    
        if IsArray(arrProducts) then    
    
            For i = 0 to ubound(arrProducts, 2) %>    
      
            <option value="<%= arrProducts(1,i)%>" <%= selectProduct(arrProducts(0,i)) %>> <%= arrProducts(0,i) %> </option>  
			
			<%
			
    
           next    
    
             else %>    
    
            <option value=""> Select Department </option>    
    
        <% end if %>    
    
       </select> 

	   <span class="input-group-btn">
                                    <button class="btn btn-danger btn-lg" type="submit">
                                        Go
                                    </button>
                                </span>

								</div>
		
		</form>
		</div>
	</div>
</div>
		

<div class="container">
	<div class="table-responsive">
		
		
		<table class="table-bordered table table-striped table-border custab">
		<% if not rs.EOF  Then %>
  <thead>
  <tr>
  <th>First Name</th>
  <th>Last Name</th>
  <th>Dept</th>
  <th>Title</th>
  <th>Office</th>
  <th>Ext</th>
  <th>Email</th>
  </tr>
  </thead>
  <% 
  Else
  %><td><span style="color:red;text-align:center;">No Record Found</span></td><%
  end if %>
  <tbody>


 
  <%do until rs.EOF%>
  <tr>
 
  <%for each x in rs.Fields%>
    <td><%Response.Write(x.value)%></td>
  <%next
  rs.MoveNext%>
  </tr>
<%loop
rs.close
conn.close
%>
</tbody>
</table>
		
	</div>
</div>


</body></html>

Open in new window

0
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
You're going to have to figure out what the actual error is. Perhaps check the Event Viewer on the server.
0
 
Cedar Crest CollegeAuthor Commented:
I was finally able to get the detailed errors turned on -- it was under Error Pages - here is the error:

ADODB.Connection error '800a0e7a'

Provider cannot be found. It may not be properly installed.

/directory/directory.asp, line 6
0
 
crystal (strive4peace) - Microsoft MVP, AccessRemote Training and ProgrammingCommented:
hi,

IIS might need to be configured to run 32-bit applications.  Here are steps:

Using Classic ASP with Microsoft Access Databases on IIS
https://docs.microsoft.com/en-us/iis/application-frameworks/running-classic-asp-applications-on-iis-7-and-iis-8/using-classic-asp-with-microsoft-access-databases-on-iis

and here is another link:
https://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/405f5bb5-87a3-43d2-8138-54b75db73aa1.mspx

have an awesome day,
crystal
0
 
Cedar Crest CollegeAuthor Commented:
Thank you -- that did it!
0
 
crystal (strive4peace) - Microsoft MVP, AccessRemote Training and ProgrammingCommented:
you're welcome ~ happy to help
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Network Scalability - Handle Complex Environments

Monitor your entire network from a single platform. Free 30 Day Trial Now!

  • 7
  • 3
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now