?
Solved

Database Results Error

Posted on 2006-06-06
6
Medium Priority
?
219 Views
Last Modified: 2013-12-24
In FrontPage I have a page the may return a "Database Results Error" when the database is not online. I want to remove this error because it shows the the directory of the database as follows:

Database Results Error
Could not find file 'D:\WWWRoot\mysite.com\www\fpdb\database.mdb'.

Not only do I dont want to show the location of the database on the server but it changes the formatting of the TABLE where the database results region is located.

How can I remove this error, or at least, remove the directory?
0
Comment
Question by:jfs9900
3 Comments
 
LVL 2

Expert Comment

by:Eme-Eleonu
ID: 16850537
On the page add this short script.
<% on error resume next%>

it will prevent users from seeing the cause of the error and try to run the next line of code. it will only work if your page is an asp (Which I presume) using VB

If you use asp or VB then open the offending file in HTML view and add this script somewher in your connection string.

<%
connectionString = "DBQ=C:\inetpub\wwwroot\thissite\bd.mdb;driver={Microsoft Acess Driver (*.mdb)}
' this is the code to handel error -
' you can add as many response.write lines to add html to your error page
err.Clear
on Error Resume Next
Set ConnPassowrd=server.createObject(ADODB.connection")
ConnPassword.Open ConnectionString

If Err.Number <> 0 Then

Response.Write("<br>Opps.<br>")
Response.Write("<br>An Error Occoured. Please Comeback tomorrow<br>")
Response.Write("<br>Opps. An Error Occoured. Please Comeback tomorrow<br>")
Response.End
End If
On Error Goto 0
 %>
0
 

Author Comment

by:jfs9900
ID: 16856651
When I try to put the <% on error resume next%> in the ASP code FP just overwrites it.

Is there another place I can put the code?
0
 
LVL 1

Accepted Solution

by:
TJ_TJ earned 2000 total points
ID: 16940313
Hi,

FrontPage will not allow to add/edit code in pages designed through Database Results Wizard. You can make a Database Connection check in your default document (default page); depending on the result you can redirect request to Results Page or show a user-friendly message.

~TJ
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When setting up new project requests for our site, one of the most powerful tools our team has available to use is Axure (http://www.axure.com/). It’s a tool for creating software and web prototypes that can function and interact as if it were the a…
Objective of This Article In 1990’s, when I was a budding software professional, I had a lot of confusion about which stream or technology, I had to choose to build my career. In those days, I had lot of confusion like whether to choose System so…
The purpose of this video is to demonstrate how to automatically show related posts at the bottom of a blog post in WordPress. This will be demonstrated using a Windows 8 PC. Plugin “Yet Another Related Posts Plugin” will be used. Go to your…
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…
Suggested Courses

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question