Array
(
)

erro no close

Edsonferreira114
   - 21 mai 2008

tenho o codigo abaixo em um formulario acessando banco oracle funcionando quase perfeitamente. Só que apresenta erro quando mando fechar o formulário e executa o codigo usuario.close ( em negrito abaixo). Não consigo saber porque.

Public Class usuariosform
Dim Usuario As New ADODB.Recordset

Private Sub ToolStripButton3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton3.Click
Me.Close()
End Sub

Private Sub usuariosform_Deactivate(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Deactivate
Usuario.Close() Usuario = Nothing
End Sub

Private Sub usuariosform_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Usuario.CursorLocation = ADODB.CursorLocationEnum.adUseClient
Usuario.Open(´select * from dpc_usuario ´, Conexao2, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockReadOnly)
Do While Not Usuario.EOF
Me.TextBox1.AutoCompleteCustomSource.Add(Usuario.Fields(´USUARIO´).Value)
Usuario.MoveNext()
Loop
End Sub

Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click
End Sub

Private Sub TextBox1_RegionChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.RegionChanged

End Sub

Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged

End Sub
End Class