This is really frustrating me!
I have an issue where closing an OleDB connection (to an Access 2010 database) terminates processing (of the remainder of the routine) without throwing any error. This seems to happen in more than one place and didn't happen before moving to a newer server (IIS 7.0, .Net 4.0).
I'd appreciate any thoughts on this. Here's the code that causes the problem:
... continuation of routine below ...
I have an issue where closing an OleDB connection (to an Access 2010 database) terminates processing (of the remainder of the routine) without throwing any error. This seems to happen in more than one place and didn't happen before moving to a newer server (IIS 7.0, .Net 4.0).
I'd appreciate any thoughts on this. Here's the code that causes the problem:
' sConnectionString is set properly as everything else executes correctly ' connection string = Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\bam.accdb;Persist Security Info=False; Dim conn As OleDbConnection = New OleDbConnection(sConnectionString) Dim cmd As OleDbCommand = New OleDbCommand() Dim sdr As OleDbDataReader Dim sql As String = "SELECT [order_user_id], [order_pay_status] FROM [Orders] WHERE [order_id] = " & sOrderID Try conn.Open() cmd = New OleDbCommand(sql, conn) errRoutineName = "OrderIPN:ReadOrderPayStatus" sdr = cmd.ExecuteReader(Data.CommandBehavior.SingleRow) Dim bFound As Boolean = sdr.Read() If bFound Then sUsrID = sdr("order_user_id") & "" iPay = DBNullToInteger(sdr("order_pay_status")) End If sdr.Close() ' *** THIS line causes the problem - everything else works correctly and even retrieves "order_user_id" and "order_pay_status" from the database. conn.Close() ' *** We never get here! Catch ex As Exception HandleDBError() Exit Sub End Try End If ' *** We never get here either!
... continuation of routine below ...
Last edited by a moderator: