Il 14/04/2014 0.22, Joe Mistachkin ha scritto:
Stefano Ravagni wrote:
Hello Joe, here my code for CloseDati to help you to reproduce the error
that i don't understand...
++++++++++++++++++
Public Sub CloseDati()
'chiude i dati del datareader associati all'oggetto DATI cui
' spesso sono attaccati anche altri oggetti come
' l'oggetto ObjCmd
Try
If IsNothing(Dati) = False Then
If Dati.IsClosed = False Then Dati.Close()
End If
Catch ex As Exception
Call ScriviLog("ModConnessione.CloseDati", ex.Message)
MsgBox("ERRORE DURANTE LA CHIUSURA DEI DATI APERTI!" & vbCrLf
& vbCrLf & ex.Message)
End Try
End Sub
Just seen the image attachment i sent which demostrate i obtain the error
?
I'm still unable to reproduce the issue. Is an exception being caught by
this
method while trying to close the data reader? Also, perhaps instead of
using
the IsNothing function, you might want to change the "If" expression to:
If Not Dati Is Nothing Then
In theory, changing the "If" expression should not make any difference;
however,
I seem to recall that the IsNothing function was typically used for checking
the
sub-type of a Variant (i.e. and not for checking for null references). Of
course,
I have not used Visual Basic.NET for quite a long time and I may be wrong.
--
Joe Mistachkin
_______________________________________________
sqlite-users mailing list
Hello Joe, tryed to change the code in the IF expression but nothing
change....
I would ask if you seen the screenshot i attached somes days ago because
it show what happen....
From debugger Datareader result CLOSED and HasRows properties result NO
ROWS, but i obtain the error wich say datareader is open !
The error happen at line were i set command connection properties as in
the code above...
Try
Call CloseDati() ' which call Dati.Close()
objCmd.Connection = Connetti *** HERE HAPPEN THE ERROR ***
objCmd.CommandText = strSQLvar
Dati = objCmd.ExecuteReader()
...........
--------------------------------------------------------------------------
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users