How 2 Generate an ADO error to test error handling.asp

Results 1 to 3 of 3

Thread: How 2 Generate an ADO error to test error handling.asp

  1. #1
    Michael Clark Guest

    Default How 2 Generate an ADO error to test error handling.asp

    What is a safe way to generate an error when connecting to an access dbase to test the error handler.asp example?

  2. #2
    Join Date
    Dec 1969
    Posts
    2,849

    Default RE: How 2 Generate an ADO error to test error handling.asp

    Well, just pass some random string to the database:<BR><BR>strSQL = "Hello, my name is Scott..."<BR>objRS.Open strSQL, objConn<BR><BR>Some ways I tested it was to take a valid SQL string, and then add a random character to the front of the string. So "INSERT INTO Table1 ..." became "fINSERT INTO Table1 ..."<BR><BR>Good luck, and happy programming!

  3. #3
    Michael Clark Guest

    Default RE: How 2 Generate an ADO error to test error handling.asp

    I tried passing a bogus sql string like you said. The ON Error Resume Next line ends up ignoring the error handling. WHen I put that line in, although the sql is bad, the code still tries to loop through the recordset endlessly because it can not find the EOF. Any suggestions on where I am missing it? Does this have anything to do with what type of database I am hooking to?

Posting Permissions

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