Error trapping

Results 1 to 2 of 2

Thread: Error trapping

  1. #1
    Inanna Guest

    Default Error trapping

    When error trapping everything seems to work fine trapping some errors using "Server.CreateObject("ADODB.Error")" and others using "objErr in objConn.Errors" BUT if the database file I am trying to connect to with the connection string doesn&#039;t exist I get the error <BR>Microsoft OLE DB Provider for ODBC Drivers error &#039;80004005&#039;<BR>[Microsoft][ODBC Microsoft Access Driver] Could not find file &#039;(unknown)&#039;.<BR>How can I trap this error? <BR><BR>

  2. #2
    Inanna Guest

    Default Found it!!

    It seems my error trapping routine is fine it was just that it needed to be called straight after defining the connection string <BR><BR>objConn.ConnectionString=..... <BR>CheckForConnectionErrors<BR><BR>I put it after the objConn.Open.<BR>This must mean that when the connection is defined it actually goes and checks that the database file is there instead of waiting until the .Open connection call.<BR>I must admit it is great to find resolutions to problems but that such a trivial thing could keep my mind whirring for 24 hours has knocked my programming ego down a peg or two :)<BR><BR>Hope this post helps someone else one day.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts