Réponse acceptée !
Petite fonction se basant sur ADOX pour créer un champ de type texte :
Public Function CreateColumnTexte(ByRef oCatalog As ADOX.Catalog, ByRef oTable As ADOX.Table, ByVal sColumnName As String, ByVal sColumnDescription As String, ByVal lTaille As Long, ByVal bChaineVideAutorisee As Boolean, ByVal bNullAutorise As Boolean, ByVal bIsCompressed As Boolean, ByVal sDefaultValue As String, ByVal sValidationRule As String, ByVal sRuleText As String) As Boolean
'======================================================================
'Function : CreateColumnTexte
'Date : 08/03/2005
'Auteur : DarK Sidious
'But : Permet de recréer un champ de type texte dans la table
'======================================================================
'on active la routine de traitement d'erreur
On Error GoTo erreur0
'déclaration des variables privées
Dim oColumn As ADOX.Column 'stocke le champ à ajouter à la base
Set oColumn = New ADOX.Column
Let oColumn.Name = sColumnName
Let oColumn.Type = adWChar
Set oColumn.ParentCatalog = oCatalog
Let oColumn.Properties("Description").Value = sColumnDescription
Let oColumn.DefinedSize = lTaille
Let oColumn.Properties("Jet OLEDB:Allow Zero Length").Value = bChaineVideAutorisee
Let oColumn.Properties("Nullable").Value = bNullAutorise
Let oColumn.Properties("Jet OLEDB:Compressed UNICODE Strings").Value = bIsCompressed
Let oColumn.Properties("Default").Value = sDefaultValue
Let oColumn.Properties("Jet OLEDB:Column Validation Rule").Value = sValidationRule
Let oColumn.Properties("Jet OLEDB:Column Validation Text").Value = sRuleText
Call oTable.Columns.Append(oColumn)
'la fonction a réussie
Let CreateColumnTexte = True
Exit Function
'routine de traitement d'erreur
erreur0:
'Problème : On n'a pas pu créer le champ
'Solution : On renvoie une valeur d'erreur : False
Let CreateColumnTexte = False
End Function
DarK Sidious
Un API Viewer (pour le VB, VB.NET, C, C# et Delphi) : www.ProgOtoP.com/popapi/