Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Setting an Access 97 Field to allow null values
Message
 
À
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:
00558438
Vues:
23
>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

Hi,

Code below may give you a lead:
    Set rstResults = New ADODB.Recordset
    With rstResults
        .CursorLocation = adUseClient
        .LockType = adLockOptimistic
        .Fields.Append "ID", adChar, 6, adFldIsNullable
        .Fields.Append "Name", adChar, 37, adFldIsNullable
        .Fields.Append "Birthdate", adChar, 10, adFldIsNullable
        .Fields.Append "Phone", adChar, 10, adFldIsNullable
        .Fields.Append "City", adChar, 30, adFldIsNullable
        .Fields.Append "State", adChar, 2, adFldIsNullable
        .Fields.Append "Status", adChar, 3, adFldIsNullable
        .Fields.Append "Source", adChar, 9, adFldIsNullable
        .Open
    End With
HTH
Igor Gelin
Database Developer
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform