1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| Public Function Execute() As DataView
If m_Mdb.Length = 0 Or m_SQL.Length = 0 Or m_Provider.Length = 0 Then
MsgBox("Chaine vide")
Exit Function
End If
Try
Dim SourceConnect As String = "Provider=" & m_Provider & ";" & "Data Source=" & m_Mdb
SourceOle = New OleDbConnection(SourceConnect)
Select Case SourceOle.State
Case ConnectionState.Closed
SourceOle.Open()
End Select
Dim DataA As New OleDbDataAdapter(m_SQL, SourceOle)
Dim DataS As New DataSet
DataA.Fill(DataS, "Obj")
Try 'return incorrect sur du Update
Return DataS.Tables("obj").DefaultView
Catch ex As Exception
Finally
If m_Open = False And SourceOle.State = ConnectionState.Open Then SourceOle.Close()
End Try
Catch ex As Exception
MsgBox("Erreur de transaction avec la Base : " & ex.Message)
End Try
End Function |
Partager