I am trying to trap the error that raises when you attempt to query a
database that does not exist. noted that DAO.DBEngine.Error.Count does
contain the value of how many errors have happened. Just cant seem to
catch the error so that It can be handled correctly, heres what I am
trying to do so far
code:
Private Sub CheckReferenceTable()
on DBEngine.Errors.Count < 1 goto referencehandler
sqlCommand = "Select * FROM [REFERENCE]"
DB.OpenRecordset sqlCommand
Exit Sub
ReferenceHandler:
sqlCommand = "CREATE TABLE [REFERENCE] ([TABLE NAME])": Set RS =
DB.OpenRecordset(sqlCommand)
CheckReferenceTable
End Sub
NOte the on statement is theoretical to get the idea across
On Error Resume Next will not work in this instance.
--
http://www.dbForumz.com/ This article was posted by author's request
Articles individually checked for conformance to usenet standards
Topic URL:
http://www.dbForumz.com/DAO-Error-Trapping-ftopict172906.html
Visit Topic URL to contact author (reg. req'd). Report abuse:
http://www.dbForumz.com/eform.php?p=580080