Un esempio:
codice:
w_crea = ""
Set rs = connessione.execute("SELECT * FROM tabella")
For Each objField In rs.Fields
nome = objField.Name
tipo = objfield.Type
lung = objfield.DefinedSize
select case tipo
case 2,3 ' numerico intero
w_crea = w_crea & ", " & nome & " LONG"
case 4,5,14 ' numerico frazionario
w_crea = w_crea & ", " & nome & " DOUBLE"
case 6 ' numerico valuta
w_crea = w_crea & ", " & nome & " CURRENCY"
case 7 ' data
w_crea = w_crea & ", " & nome & " DATE"
case 11 ' booleano
w_crea = w_crea & ", " & nome & " BIT"
case else ' stringa
w_crea = w_crea & ", " & nome & " VARCHAR (" & lung & ")"
end select
Next