The problem is not occuring now and Im not sure what Ive done to solve it.
I was finding it hard to debug because I did not get an option to 'Break'
and step into the code to see where the problem was occuring. After a lot
of trial and error I narrowed it down to a procedure that was being called
every 5 secs (for testing purposes only).
It was failing on the cnn.Open() line after a random number of times ie it
might work fine for 30 times and then fail on the 31st time
I tried wrapping open in a try catch block but the error message still
appeared. Im not on dev machine at moment so I cant bring up the error, but
as I remember it was a JIT debug error if that makes any sense. It didnt
allow be to break & see the line where the error occured
Procedure Code
================================================== =================
Function Load(ByVal lngID As Long) As Boolean
Dim booRetVal As Boolean
Dim cnn As Data.OleDb.OleDbConnection
Dim cmm As Data.OleDb.OleDbCommand '.SqlClient.SqlCommand
Dim dr As Data.OleDb.OleDbDataReader
Dim objStaffAction As clsStaffAction
Dim strSQL As String
cmm = New Data.OleDb.OleDbCommand '.SqlClient.SqlCommand
strSQL = "SELECT tlkStaff_Actions.* " & _
"FROM tlkStaff_Actions LEFT JOIN tlkStaffAction_Vote " & _
"ON tlkStaff_Actions.stac_lng_id =
tlkStaffAction_Vote.stav_stac_lng_id " & _
"WHERE tlkStaffAction_Vote.stav_stac_lng_id Is Null " & _
"and stac_staf_lng_id_to = " & g_objStaffCurrentUser.ID
cnn.ConnectionString = CNN_CONNECT
cnn.Open()
cmm.Connection = g_cnn ' cnn
cmm.CommandType = CommandType.Text
cmm.CommandText = strSQL
dr = cmm.ExecuteReader
While dr.Read
objStaffAction = New clsStaffAction
booRetVal = objStaffAction.Load(dr)
m_colStaffAction.Add(objStaffAction, "K:" & objStaffAction.ID)
End While
dr.Close()
'Tidy Up
cnn = Nothing
cmm = Nothing
dr = Nothing
objStaffAction = Nothing
Load = booRetVal
End Function
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:eC**************@TK2MSFTNGP10.phx.gbl...
"Terry Holland" <nochance> schrieb: Im getting and Unspecified Error in my VB.Net app and am
not sure how to debug it.
Where and when does this error occur?
--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>