Bonjour,
Un truc comme ça ?
' Définition des types de champs
Function GetFieldType(FieldType)
Select Case FieldType
Case 200
GetFieldType= "VarChar"
Case 139
GetFieldType= "Number"
Case 131, 2, 3, 5
GetFieldType= "Number"
Case 135
GetFieldType= "Date"
Case 201
GetFieldType= "Clob"
Case Else
GetFieldType= "Unknown"
End Select
End Function
Set Conn = Server.CreateObject("ADODB.Connection" )
Set FieldsRs = Server.CreateObject("ADODB.Recordset" )
Conn.Open MonDSN
' Récupération des noms de champs
SQL = "Select * from MaTable where 1=2"
fieldsrs.Open SQL, Conn, 0, 1
For j = 0 to fieldsrs.Fields.count-1
' Remplissage de la liste
msgbox "MaTable." & lcase(fieldsrs.Fields(j).Name) & " (" & GetFieldType(FieldsRs.Fields(j).type) & " )"
Next
fieldsrs.Close
Conn.Close
Set Conn = Nothing