ColdFusion and (MS)SQL - catching db unavailability errors

Discussion in 'Programming' started by strivinglife, Jun 1, 2006.

  1. #1
    I'm looking for a fairly non-disruptive way to catch both SQL db unavailability and errors, in the style of PHP-MySQL.

    With PHP, if you can't connect to a db, you can abort further calls within the function and output some error text. (mysql_connect() or die())

    With ColdFusion, I've only seen a way to implement a complete page substitution, unless one uses cfcatch and cftry. Is this the only method?


    What I'd like to do: Check to see if ColdFusion can connect to MSSQL. If it can't, display a message within the template that the service is temporarily unavailable. This is also a unique error to this service - we don't want this to be our standard error.

    Do I have a PHP like option - or, what are my options?

    Thanks all,

    ~J
     
    strivinglife, Jun 1, 2006 IP
  2. ccoonen

    ccoonen Well-Known Member

    Messages:
    1,606
    Likes Received:
    71
    Best Answers:
    0
    Trophy Points:
    160
    #2
    catch and try i think is the only option my friend (but i haven't dabbled really with the new cf 7 options)
     
    ccoonen, Aug 12, 2006 IP
  3. strivinglife

    strivinglife Peon

    Messages:
    250
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Well, that's unfortunate ...
     
    strivinglife, Aug 13, 2006 IP