Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using ADOX to find column properties
Message
 
À
17/09/2001 15:13:44
Information générale
Forum:
Visual Basic
Catégorie:
Bases de données DAO/RDO/ODBC/ADO
Divers
Thread ID:
00556648
Message ID:
00557596
Vues:
18
>>>Thanks for the information Eric. Just one last question. I've been looking at the ADOX MSDN page and I can't find the column property that shows whether the field is required or not. Do you know how to get that?
>
>>Can you use Jet OLEDB:Allow Zero Length?
>
>I am using that for text fields but I need to know the Required property setting too. If you open an Access table in design view and look at the General Tab on the bottom there is a place for Required and Allow Zero Length for taxe fields but for other types of data you can set the Required but there is no option for Allow Zero Length.
>
>Other suggestions?

Using ADO OpenSchema method, you can check for the IS_NULLABLE field property. Here are some lines:
'pconConnection is a valid ADODB Connection
Set rstInfo = pconConnection.OpenSchema(adSchemaColumns, Array(Empty, Empty, "YourTableName", Empty))
strAttributes = strAttributes & _
IIf(rstInfo.Fields("IS_NULLABLE").Value, "", "Not ") & "Nullable" & vbCrLf
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform