Wrox Programmer Forums
|
Classic ASP Components Discussions specific to components in ASP 3.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Components section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 6th, 2004, 11:12 PM
Authorized User
 
Join Date: Sep 2003
Posts: 81
Thanks: 0
Thanked 0 Times in 0 Posts
Default Trapping errorerror '80004005'

I am trying to trap unavailable database errors so that when i am doing maintenance by user dont just get the ugly

"Microsoft JET Database Engine error '80004005'

Could not find file 'C:\hshome\topshed\xxxx.mdb'"

I have a 500 error page in php but I annot seem to connect the two

<500 error script>
<?php
$reason = "Internal Server Error";
$explain = "The document you requested cannot be delivered due to errors. An
E-Mail with the details of the request has been forwarded to the appropriate
person/s.";
?>
<html>
<head>
<title>Error : <?=$reason?></title>
</head>
<body bgcolor="white" text="black">
<center>Error : <?=$reason?></center>
<br />
<p>
<?=$explain?>
</p>
</body>
</html>
<?php
mail("[email protected]", "Internal Server Error ",
"Cookies:nn$HTTP_COOKIEnnnRemote IP: $REMOTE_ADDRnnnServer Name :
$SERVER_NAMEnnnServer Port : $SERVER_PORTnnnUser :
$REMOTE_USERnnnRequest URL : $REQUEST_URInnnReffering page :
$HTTP_REFERERnnnQuery string: $QUERY_STRING","From:
[email protected]lhostn");
?>

Any help appreaciated I have been fighting this for weeks and I just cannot get a handle on it

thanks Topshed
 
Old October 7th, 2004, 08:31 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

Firstly: This is an ASP forum. That code you are writting there aint ASP, you would get more help on the phpGeek (not taking the pis - thats it's name) forum

Secondly: This is not an ugly error:
-----------------
"Microsoft JET Database Engine error '80004005'
Could not find file 'C:\hshome\topshed\xxxx.mdb'"
-----------------
It's actualy very useful. To translate it for you:
can not find your .MDB file
(http://support.microsoft.com/default...b;EN-US;306269)

Thirdly: Why would you want to use access when mySql is free (PHP's prefered and naitive database) I use SQLYOG as my windows interface for using mySql4.0 - wow what a tool, 10 times beter than phpMyAdmin!!!
NOTE: SQLYOG costs $49 and phpMyAdmin is free. Running Sokkit (Apache, php) on windows,runs like a dream.

Anyhow, you have to use an ODBC connection to get rid of your error. You havnt posted your connection string, this is where your error is, you should connect like so:
1..create an ODBC connection
2..Use the odbc_connect() function is used to connect
3..The odbc_exec() function is used to run statements
EG:
$conn=odbc_connect('dbName','uName','Password');
$sql="SELECT stuff FROM stuff";
$getInfo=odbc_exec($conn,$sql);

Better option - use mySql if you are writting PHP








Wind is your friend
Matt
 
Old October 7th, 2004, 09:40 PM
Authorized User
 
Join Date: Sep 2003
Posts: 81
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Matt,

Thank for the speedy reply

I would love to switch to MySQL, trouble is I have 7 tables in a database of 10Meg, and I cannot find a free tool to convert it to SQL, otherwise I would.

The error is not my connection string, everything works well its just when I do a large update and have to bring the Database side of the site down for 30 mins or so, I want to display a custom error message explaining why that error is occuring, if anyone tries to access the DB during that period
 
Old October 7th, 2004, 10:06 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

;;;The error is not my connection string

mmm, i'm confused. Why am I confused:

;;;Could not find file 'C:\hshome\topshed\xxxx.mdb'"
means what it says and this path is in your connection string.

Anyway
;;;its just when I do a large update and have to bring the Database side of the site down for 30 mins or so,

This I has to read five times, thought I was hallucinating however it seems to say what it says. I know ODBC connections are slow and should be used 'in my opinion' only when absolutly neccessary - not that slow though.

Access to mySql (there are many ways to do it)
http://www.kitebird.com/articles/access-migrate.html


Wind is your friend
Matt





Similar Threads
Thread Thread Starter Forum Replies Last Post
error trapping majones@omaha Classic ASP Basics 0 January 5th, 2006 02:02 PM
Need some error trapping... cpk Classic ASP Databases 4 January 26th, 2005 08:10 AM
Trapping Close Window in C# YiannisF ASP.NET 1.0 and 1.1 Basics 1 September 6th, 2004 06:06 AM
Trapping all events rajustha Pro VB.NET 2002/2003 1 December 10th, 2003 12:45 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.