Hi David,

> I need to find a way to check if the Peoplesoft DB is down
> (i.e. if the database link is valid) and display a friendly
> error message to the user before they have logged into the
> application.

Have you tried connection.state?

When you open your connection, if it returns an error, switch to your
error handler.

'// ========================================================
' create your variables
  Dim liter, cn, sErrors

' this is required in order to trap the error
  on error resume next

' create the connection
  Set cn = server.createobject("adodb.connection")

' attempt to open it
  cn.open "your connection string"

' see if you succeeded
  if cn.errors.count > 0 then

  ' obtain information about the errors
    for liter = 0 to cn.errors.Count - 1
      sErrors = sErrors & "<p>" & cn.errors(liter) & "</p>"
    next

  ' clean up
    cn.errors.clear
    set cn = nothing

  ' store the errors for later
    session("errors") = sErrors

  ' kick them to an error page
    response.redirect "/disabled.asp"

  end if

' turn off ignoring errors for the rest of your code
  on error goto 0

...do your db stuff here
'// ========================================================

Regards,

Shawn K. Hall
http://ReliableAnswers.com/

'// ========================================================
    There's not a lot of money in revenge.
      -- 'Inigo', The Princess Bride




------------------------ Yahoo! Groups Sponsor --------------------~--> 
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/17folB/TM
--------------------------------------------------------------------~-> 

---------------------------------------------------------------------    
 Home       : http://groups.yahoo.com/group/active-server-pages
---------------------------------------------------------------------
 Post       : [EMAIL PROTECTED]
 Subscribe  : [EMAIL PROTECTED]
 Unsubscribe: [EMAIL PROTECTED]
--------------------------------------------------------------------- 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/active-server-pages/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply via email to