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.OleD bConnection
Dim cmm As Data.OleDb.OleD bCommand '.SqlClient.Sql Command
Dim dr As Data.OleDb.OleD bDataReader
Dim objStaffAction As clsStaffAction
Dim strSQL As String
cmm = New Data.OleDb.OleD bCommand '.SqlClient.Sql Command
strSQL = "SELECT tlkStaff_Action s.* " & _
"FROM tlkStaff_Action s LEFT JOIN tlkStaffAction_ Vote " & _
"ON tlkStaff_Action s.stac_lng_id =
tlkStaffAction_ Vote.stav_stac_ lng_id " & _
"WHERE tlkStaffAction_ Vote.stav_stac_ lng_id Is Null " & _
"and stac_staf_lng_i d_to = " & g_objStaffCurre ntUser.ID
cnn.ConnectionS tring = CNN_CONNECT
cnn.Open()
cmm.Connection = g_cnn ' cnn
cmm.CommandType = CommandType.Tex t
cmm.CommandText = strSQL
dr = cmm.ExecuteRead er
While dr.Read
objStaffAction = New clsStaffAction
booRetVal = objStaffAction. Load(dr)
m_colStaffActio n.Add(objStaffA ction, "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******** ******@TK2MSFTN GP10.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/>