salut tous le monde
j'essay de creer une table avec des champs ùmais il ya une erreur 3421
merci d'avance
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 Private Sub Command2_Click() Dim W As Workspace Dim BD As Database Dim t As TableDef Dim F As Field: Dim R As Recordset p = App.Path & "\ma_base.mdb": If Dir(p) <> "" Then Kill p Set W = DBEngine.Workspaces(0) 'creer la base de donneé Set BD = W.CreateDatabase(p, dbLangGeneral, dbVersion30) 'creer la table Set t = BD.CreateTableDef(tab_name.Text) 'creer les champs For x = 0 To f1.ListCount - 1 Set F = t.CreateField(field_name.List(x), field_type.List(x), 100) t.Fields.Append F Next x BD.TableDefs.Append t W.Close End Sub
Partager