Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Another ADO Question
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00618990
Message ID:
00618999
Views:
13
>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.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform