MySql DatabaseException not being caught

Hello all.

I’m trying to test the new DatabaseException of API 2 with a MySqlCommunityServer. The following code will connect to the database successfully when I provide the correct values for the mDatabaseID properties. However, when I intentionally provide an invalid value for any of the properties there is a DatabaseException raised but it is not caught. Instead, it drops in to the debugger. Is there something I’m missing?

[code]mDatabaseID = New MySQLCommunityServer
mDatabaseID.Host = sHost
mDatabaseID.Port = iPort
mDatabaseID.UserName = sUser
mDatabaseID.Password = sPassword
mDatabaseID.DatabaseName = sDatabase

Try
mDatabaseID.Connect
Catch error As DatabaseException
MessageDialog.Show("Database error. " + error.Message)
End Try[/code]

Thank you for any help you can provide.

That is expected behavior. You can click on the continue button to catch the error or put

#pragma breakonexceptions off

prior to the Try line.

Look in the Project menu and make sure ‘Break on Exceptions’ is not selected.

Thank you Wayne and Robin. For whatever reason, I don’t remember coming across those options but I’m sure I did somewhere. I’m going to attribute this lapse to age or selective memory. But, unfortunately with age comes the other. Sigh.

“I complain that the years fly past, but then I look in a mirror and see that very few of them actually got past.” ~ Robert Brault -