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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
| Public Class MAIN
Public con As New OleDb.OleDbConnection
Public dbProvider As String
Public dbSource As String
Public ds As New DataSet
Public da As OleDb.OleDbDataAdapter
Public SQL As String
Sub connection()
Dim ip As String
ip = My.Computer.Name
dbProvider = "PROVIDER=Microsoft.ACE.OLEDB.12.0;"
If ip = "COTE-41F9E2EDFD" Then
dbSource = "Data Source = U:\pmg\db\pmg dessin.mdb"
Else
dbSource = "Data Source = y:\daniel cote\db\pmg dessin.mdb"
End If
con.ConnectionString = dbProvider & dbSource
con.Open()
end sub
Sub DataGridView1_CellValueChanged(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellValueChanged
Dim cb3 As New OleDb.OleDbCommandBuilder(da)
da.Update(ds.Tables(0))
End Sub
Sub FiltreProjet_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FiltreProjet.SelectedIndexChanged
FiltreSection.Text = ""
FiltrePlan.Text = ""
REMPLIR_FILTRE(FiltreProjet.Text, FiltreSection.Text, FiltrePlan.Text)
sql = "SELECT * FROM bom WHERE LIGNE_BOM LIKE '" & FiltreProjet.Text & "-%'"
da = New OleDb.OleDbDataAdapter(SQL, con)
ds.Clear()
ds.Reset()
da.Fill(ds, "data")
countt = ds.Tables.Count
DataGridView1.DataSource = ds.Tables(0)
End Sub
Sub FiltreProjet_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FiltreProjet.SelectedIndexChanged
FiltreSection.Text = ""
FiltrePlan.Text = ""
REMPLIR_FILTRE(FiltreProjet.Text, FiltreSection.Text, FiltrePlan.Text)
sql = "SELECT * FROM bom WHERE LIGNE_BOM LIKE '" & FiltreProjet.Text & "-%'"
da = New OleDb.OleDbDataAdapter(SQL, con)
ds.Clear()
ds.Reset()
da.Fill(ds, "data")
DataGridView1.DataSource = ds.Tables(0)
End Sub |
Partager