Author |
Topic  |
|
Laurie
Starting Member
2 Posts |
Posted - 09 July 2003 : 23:15:33
|
Hi,
Forum is great - well done. Found an issue that was easily fixed. Say your .mdb is locked or missing for whatever reason, and someone trys to use the forum. On our hosted IIS, a message comes up saying:
------- Microsoft JET Database Engine error '80004005'
Could not find file 'D:\webspace\.......secret_databasename.mdb'.
/forums/inc_header.asp, line 115 -------
Most disconcerting! So, I added this patch:
-------- inc_header.asp ~ line 115 -----------
set my_Conn = Server.CreateObject("ADODB.Connection") On Error Resume Next ' <<== Added this my_Conn.Open strConnString ' vvv Added this vvvv if Err.Number<>0 then Response.Write "<br><br><br><center><h3>Apologies .. forums temporarily offline</h3></center>" Response.Write "<br><br><center><a href='/'>Click here to continue</a></center>" Response.End end if' ^^^ END OF ADD ^^^
------------------------------
Is this of any use, or have I missed the plot!? :-)
Many Thanks, Laurie
|
|
ruirib
Snitz Forums Admin
    
Portugal
26364 Posts |
Posted - 10 July 2003 : 01:26:44
|
As long as the folder is outside your web folders, say above the web root folder (and it should be!) that won't give you much trouble. However the added code may indeed be useful. |
Snitz 3.4 Readme | Like the support? Support Snitz too |
 |
|
MasterOfTheCats
Junior Member
 
103 Posts |
Posted - 10 July 2003 : 02:26:12
|
Does this work for all databases (inc. MySQL)? |
 |
|
OneWayMule
Dev. Team Member & Support Moderator
    
Austria
4969 Posts |
|
MasterOfTheCats
Junior Member
 
103 Posts |
Posted - 10 July 2003 : 07:46:38
|
I mean, shouldn't it check
my_Conn.Errors.Count and my_Conn.Errors(counter).Number as well as it is done in sub ChkDBInstall()?
|
 |
|
Laurie
Starting Member
2 Posts |
Posted - 10 July 2003 : 10:14:01
|
Yep - as you suggest, if the file is outside the www area, all is well. Unfortunately, our provider doesn't allow this. I mentioned this and was very pleased to find that although the error message appears showing the location of the .mdb, that have some sort of filter activated on IIS which prevents download of Access .mdb's.
Cheers .. Laurie  |
 |
|
Gremlin
General Help Moderator
    
New Zealand
7528 Posts |
Posted - 10 July 2003 : 10:15:23
|
No, I don't beleive theres any need for that, if the connection can't be made a vbscript error is generated and checking that I think should be all thats required.
Whats probably required though is resetting the on error resume next statement by adding "On Error Goto 0" after the extra code. |
Kiwihosting.Net - The Forum Hosting Specialists
|
 |
|
HuwR
Forum Admin
    
United Kingdom
20595 Posts |
Posted - 10 July 2003 : 10:27:09
|
quote:
Yep - as you suggest, if the file is outside the www area, all is well. Unfortunately, our provider doesn't allow this. [quote] You should challenge them about this, it is very bad practice to store database within your web folders. [quote] I mentioned this and was very pleased to find that although the error message appears showing the location of the .mdb, that have some sort of filter activated on IIS which prevents download of Access .mdb's
This is fine as long as a) they actually try to download it rather than access it remotely via forms and b) that people actually leave their db's with the default mdb extension, many people change this to make it more difficult for people to guess the db name, so they will have no protection at all |
 |
|
|
Topic  |
|