VERSION 5.00 Begin VB.Form Form1 Caption = "Form1" ClientHeight = 5490 ClientLeft = 60 ClientTop = 450 ClientWidth = 9930 LinkTopic = "Form1" ScaleHeight = 5490 ScaleWidth = 9930 StartUpPosition = 3 'Windows Default Begin VB.CommandButton Command1 Caption = "Command1" Height = 615 Left = 7680 TabIndex = 2 Top = 2280 Width = 1695 End Begin VB.TextBox Text1 Height = 495 Left = 7560 TabIndex = 1 Text = "Text1" Top = 960 Width = 2055 End Begin VB.ListBox List1 Height = 450 Left = 1440 TabIndex = 0 Top = 1080 Width = 5055 End End Attribute VB_Name = "Form1" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Dim cmd As New ADODB.Command Dim connect As ADODB.Connection Dim rec As ADODB.Recordset Private Sub Form_Load() Set connect = New ADODB.Connection Set rec = New ADODB.Recordset ''Definition du pilote de connexion connect.Provider = "Microsoft.Jet.OLEDB.4.0" ''Definition de la chaine de connexion connect.ConnectionString = "C:\Documents and Settings\est\Bureau\nouv.mdb" ''Ouverture de la base de données connect.Open ''Exécution de la requete rec.CursorLocation = adUseClient cmd.CommandText = "Update mehdi SET code=Replace(code, 'OS', 'NIV') WHERE code LIKE 'OS%'" 'cmd.CommandText = "Update mehdi SET code='" & Replace(code, "OS", "NIV") & "' WHERE code LIKE 'OS%'" 'cmd.CommandText = "Update mehdi SET code='NIV1' + SubString(code, 3, 255)WHERE code LIKE 'OS%'" cmd.ActiveConnection = connect Set rec = cmd.Execute connect.Close End Sub