ExecuteNonQuery halts thread
I'm calling the ExecuteNonQuery method of a oledbcommand object. This is done in a class module which runs it's own thread.
When I call the method, the thread seems to freeze, sleep, disappear whatever. The execution never get's to the next line.
Errorhandlers aren't firing either.
Anyone know what could cause this? And How do I solve this?
Code:
Dim DBCmd As New OleDb.OleDbCommand()
Dim Sql As String
Sql = "INSERT INTO ....."
DBCmd.CommandText = Sql
DBCmd.Connection = SYS_DBMails ' open OledbConnection
Try
Dim iRecs As Integer
iRecs = DBCmd.ExecuteNonQuery() ' "freezes" here
Catch ex As Exception
Dim s As String = ex.ToString
End Try