views:

31

answers:

1

Is it possible to insert a null value into a field using the AddNew method of an ADO Recordset in VB6? In a typcial INSERT query, you would simply use NULL; however, I've discovered that this doesn't work through ADO; it inserts "NULL" instead.

Is there another way to insert a null value when adding a new record?

A: 

Does leaving the value blank work? Can you use dbnull.value?

Beth
Nope, it just inserts a blank string into the table.
derekerdmann
Can you post your code? Also, I'm assuming inserting nulls is supported on your table and you can insert your record with null values fine through the back end.
Beth
Turns out that the null value works if I leave that column out of the field and value lists in the `AddNew` method. Thanks for your help!
derekerdmann
no problem. Glad you got it to work.
Beth