>When I run this code;
>
>
>oCommand = CREATEOBJECT("ADODB.Command")
>
>cCommandString = "insert into bspotln (docid, boid) values (" +;
>TRANSFORM(nDocId) + "," + TRANSFORM(nNewId) +")"
>
>WITH oCommand
> .CommandText = cCommandString
> .ActiveConnection = This.oConnection
> .CommandType = adCmdText
>ENDWITH
>
>oCommand.Execute
>>
>I get the error "Field 'xyz' does not accept null values". Is there a way
>to override this or turn it off? I dont want to have to fill in ALL the
>fields to add a record.
>
>Thanks
Kevin,
The table was set up so field XYZ doesn't accept NULLs. If you don't specify a value for a field in the insert statement, it gets inserted as NULL. You have to specify the field's value in the insert statement or modify the table so the field accepts NULLs or modify the field so that it has a default value.
HTH.
Larry Miller
MCSD
LWMiller3@verizon.netAccumulate learning by study, understand what you learn by questioning. -- Mingjiao