Private Sub CommandButton1_Click()
Dim MonAccess As New Access.Application
Dim I As Long, J As Long
Dim db2 As DAO.Database
Dim db5 As DAO.Database
Dim rs5 As DAO.Recordset
I = 3
Set db2 = MonAccess.OpenDatabase("C:\Documents and Settings\p034351\Desktop\base incident\DATA CTL INCIDENT.mdb" )
Set rs5 = db2.OpenRecordset("MOUVEMENT" )
Do Until rs5.EOF
For J = 0 To rs5.Fields.Count - 1
ActiveSheet.Cells(I, J + 1) = "'" & rs5.Fields(J)
Next J
I = I + 1
rs5.MoveNext
Loop
End Sub
Message édité par jpcheck le 20-03-2007 à 16:21:54