Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Setting an Access 97 Field to allow null values
Message
De
19/09/2001 17:03:40
 
 
À
19/09/2001 11:48:51
Information générale
Forum:
Visual Basic
Catégorie:
Bases de données DAO/RDO/ODBC/ADO
Divers
Thread ID:
00558371
Message ID:
00558516
Vues:
19
I think you need to completely define the columns before appending the table to the catalog so that the line cat.Tables.Append tbl will be after all columns have been defined and appended.


>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform