handling database errors

Results 1 to 2 of 2

Thread: handling database errors

  1. #1
    Join Date
    Dec 1969

    Default handling database errors

    Hi,<BR><BR>I was wondering whether there was a way to handle database errors without getting tied to a particular database.<BR><BR>I would like a method of trapping errors so that when I change my database from Access to SQLServer, i wouldn&#039;t need to change my vbScript code.<BR><BR>For example, I get a SQLState error value of 3022 (duplicate index) using the following environment: ASP/vbScript5.0/Access2000/ADO. Can I code for 3022 and hope to get the same SQLState number when I switch to SQLServer?<BR><BR>Are SQLState codes, as reported by the Error.SQLState property the way to go? If that is the preferred approach, do we have a list of enumerated values anywhere?<BR><BR>Thanks<BR><BR><BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default my advice......

    .... ditch VBScript and use JScript - which provides full try/catch/finally error handling, unlike VBScript&#039;s clumsy on error resume next. it&#039;s much much more flexible than VBScript<BR><BR>however in the case of migrating an already created app from one DB to the other, I don&#039;t think you have a lot of choice. Some ADO errors will be "the same", but others won&#039;t be.<BR><BR><BR><BR>j<BR>http://www.readthe****ingmanual.co.uk/

Posting Permissions

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