ADO Problem Updating number field to Null 
Author Message
 ADO Problem Updating number field to Null

I have a VB6 app using the good ol' ADO Data Control connected to an Access
2000 database. Seems that when I am UPDATING a existing record which
involves changing a number field's value to null, I get an error.

Scenario: I have a text box bound to a database number (type integer) field
and am trying to delete the value in that field. If I remove the value from
the field (by backspacing) and then call the update method of the data
Control, I get no error but the data DOES NOT update. If I perform the same
action in conjunction with editing another field (say a text field) I get
"Multiple-step operation generated errors" and the update fails.

Any clue what is going on here? Thanks in advance!



Sun, 08 Aug 2004 05:44:26 GMT  
 ADO Problem Updating number field to Null

Quote:
>If I remove the value from
>the field (by backspacing) and then call the update method of the data
>Control, I get no error but the data DOES NOT update.

What kind of error trapping are you using if any? If you use  "on
error resume next", then you might want to change this to see the
error.

Quote:
>If I perform the same
>action in conjunction with editing another field (say a text field) I get
>"Multiple-step operation generated errors" and the update fails.

On the Access DB, you might have the "Allow Zero Lenght" property set
to "NO". In a number field, try to specify a default value or try to
write code to handle the error if you want to have empty number
fields. I have had the same experience with Date/Time and Number
fields.

What I did was to assign a text to all the fields and just convert the
data to whatever data type when returned by my recordset and placed on
the textbox. Although this might not be the optimal solution, someone
reading this might offer one.

Regards.

Hzana



Sun, 08 Aug 2004 12:49:21 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How to update datetime field with NULL using ADO update

2. ADO autoInc number after update is null?

3. Setting Oracle Number Fields to Null Problem?

4. JET AUTO-NUMBER FIELD UPDATE PROBLEM

5. Problem updating field using ADO

6. Memo Field Update Problem ADO JET

7. ADO Finding Highest Number in ADO Recordset field?

8. Null Fields in Recordset Update

9. REQ: Updating Access date field with a Null

10. Update 'NULL' to record field

11. How to DIsplay and Update a NULL Field???

12. Update a DATE-field to a NULL-value

 

 
Powered by phpBB® Forum Software