Database Results Error

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?
jfs9900Asked:
Who is Participating?
 
TJ_TJCommented:
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
 
Eme-EleonuCommented:
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
 
jfs9900Author Commented:
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
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.

All Courses

From novice to tech pro — start learning today.