Which database are you using - access ? Are you saying that when inserting you always want that field to be null and that later it will be updated with another value - or is there a possibility that data will be entered at insert time (your sql statement with iff leads me to believe the latter) ? How are the fields defined in the table - include any default values, if nulls are allowed ...
You may have already done this - but create a string that will store the sql statement that you are passing to the execute method. Populate this string into a text box - verify that it looks correct and copy it. Go into your database software (access ?) and make a query of it and test it.
I use access2000 in this database . the data type of my record is date/time.
I want to updated the null values latter.
I already try to use the Sql query in access and i confirm the field accept the Null value but I don't try with condition IIF(),
this because I don't have this objects in access.
How can i try the condition?
Are all the fields datetime that you are inserting ? If you output the query in your code at the point before the connection execute, the sql statement would have the values of the objects (not the object references in your code) - this way you can first make sure the query is correct - then copy it and test it in access.
The problem is with the single quotes before and after the iif statement. Basically you are passing 'Null' not Null - so access is thinking string. Take them out and put them in the false part of the iif statement