I have an ASP page which queries an Access Database. Unfortunately, the database was set up in such a way that if any user has it open, it will not allow other users to access the data. Currently, when this conflict occurs, the page processes up to the point where it attempts to pull the data, and this error is then displayed:
[tt]
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Microsoft Access Driver] Could not use '\\Ad1\ad13d\LabelApp\M2M Label Program2\ID_Labels_2_3_be.mdb'; file already in use.
/SNLookupExt.asp, line 75 [/tt]
This makes perfect sense to me, but confuses the heck out of my users. I have been trying to use error handling to replace this message with something more legible to my users, but seem to be having trouble finding the correct way or place to enact this handling.
My code is currently:
[tt]
(64)listSQL="SELECT Serial_Number, MA_Number, Seq_Number, UnitNo, Model_No, Config_Part_No, Part_Rev, Description, Contract_No, Module_SN, Scan_Date, fcompany FROM qryLABSerialInfo WHERE " & section1
(65)
(66)
(67)Set Con=Server.CreateObject("ADODB.Connection")
(68)
(69)Con.Open strConnect
(70)
(71)
(72)set rstemp = Con.Execute(ListSql)
(73)
(74)If Err = "80004005" Then Response.write("An Access user has the Label Application open at this time, blocking this search request. Please Try again Later.</TD></TR></TABLE><!--#include virtual='includes/docEnd.asp'-->")
(75)If Err = "80004005" Then Response.End
(76)
(77)If rstemp.eof = True Then Ender = 0 Else Ender = 1
[/tt]
Before I entered the If>Then statements attempting to capture the error, the line that the error referenced was line 72. I have tried it treating the error both as a number and as a string (with and without the quotes).
The general error handling method matches what I found in "VBScript Unleashed" - I wonder if I am placing it incorrectly, or what I have overlooked. What am I doing wrong?
Cheryl dc Kern
[tt]
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Microsoft Access Driver] Could not use '\\Ad1\ad13d\LabelApp\M2M Label Program2\ID_Labels_2_3_be.mdb'; file already in use.
/SNLookupExt.asp, line 75 [/tt]
This makes perfect sense to me, but confuses the heck out of my users. I have been trying to use error handling to replace this message with something more legible to my users, but seem to be having trouble finding the correct way or place to enact this handling.
My code is currently:
[tt]
(64)listSQL="SELECT Serial_Number, MA_Number, Seq_Number, UnitNo, Model_No, Config_Part_No, Part_Rev, Description, Contract_No, Module_SN, Scan_Date, fcompany FROM qryLABSerialInfo WHERE " & section1
(65)
(66)
(67)Set Con=Server.CreateObject("ADODB.Connection")
(68)
(69)Con.Open strConnect
(70)
(71)
(72)set rstemp = Con.Execute(ListSql)
(73)
(74)If Err = "80004005" Then Response.write("An Access user has the Label Application open at this time, blocking this search request. Please Try again Later.</TD></TR></TABLE><!--#include virtual='includes/docEnd.asp'-->")
(75)If Err = "80004005" Then Response.End
(76)
(77)If rstemp.eof = True Then Ender = 0 Else Ender = 1
[/tt]
Before I entered the If>Then statements attempting to capture the error, the line that the error referenced was line 72. I have tried it treating the error both as a number and as a string (with and without the quotes).
The general error handling method matches what I found in "VBScript Unleashed" - I wonder if I am placing it incorrectly, or what I have overlooked. What am I doing wrong?
Cheryl dc Kern