My program hangs after several clicks that access database.
It does not matter what items I click, even if I click the same two buttons that are calling the same sub it hangs after a few times (everytime different number).
I have no idea where to start investigating. Can someone
show me the right direction?
All I do with database is get a DataReader:
Dim dr As OleDbDataReader = oDbAccess.GetData(sSQL)
Return dr
Public Function GetData(ByVal sSQL As String) As OleDbDataReader
Dim oCmd As OleDbCommand = New OleDbCommand(sSQL, cn)
Dim myReader As OleDbDataReader
Try
myReader = oCmd.ExecuteReader()
Return myReader
Catch e As OleDbException
MsgBox(e.Message)
cn.Close()
End Try
End Function
It does not matter what items I click, even if I click the same two buttons that are calling the same sub it hangs after a few times (everytime different number).
I have no idea where to start investigating. Can someone
show me the right direction?
All I do with database is get a DataReader:
Dim dr As OleDbDataReader = oDbAccess.GetData(sSQL)
Return dr
Public Function GetData(ByVal sSQL As String) As OleDbDataReader
Dim oCmd As OleDbCommand = New OleDbCommand(sSQL, cn)
Dim myReader As OleDbDataReader
Try
myReader = oCmd.ExecuteReader()
Return myReader
Catch e As OleDbException
MsgBox(e.Message)
cn.Close()
End Try
End Function