Information générale
Catégorie:
Bases de données DAO/RDO/ODBC/ADO
Titre:
Setting an Access 97 Field to allow null values
I am creating a new database using adox and then creating a new table in that database and adding all the fields. No problem.. When I go to append data into the database I get a cant allow null values in n field error that I cant seem to overcome.
I am looking and in ADOX you can set some of the properties and one of the properties is nullable but when I try to set this to true I get the following error:
Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.
I have looked up and the property as per the adox documentation is writeable but I have yet to figure out what I have done wrong.
ie.
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & strDBName & ";" & _
"Jet OLEDB:Engine Type=4;"
' *** This will create an access DB ***
Set cat = New ADOX.Catalog
cat.Create strConn
' *** This will create a Table ***
Set tbl = New ADOX.Table
tbl.name = tblName
cat.Tables.Append tbl
tbl.Columns.Append "name", lngType, lngDefLen
cat.Tables.Refresh
tbl.Columns("name").Properties("nullable").Value = True
Thanks,
Jason
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement