Access XP (2002) ADP as a client to SQL Server 2005 crashes on click on a bound Checkbox
for a Client we have to use a pretty old-fashioned Version of MS Access (2002 XP).
Now I have the following problem: On a continouus subform bound to a Recordset with a table on my SQL Server 2005 the whole MS Access application crashes whenever someone clicks on a bound Checkbox. The bound field on the SQL Server is of datatype bit.
I googled this issue and found that Access XP is not able to handle the difference between SQL Server (1 = True and 0 = False) and Access (-1 = Tru开发者_运维问答e and 0 = False) on Boolean-Values. Thus I should switch the datatype to tinyint because of this bug in Access XP. However this does not solve my problem. The application still crashes. Has someone found a solution to get a bound checkbox running in Access XP ADPs?
When you changed the data type did you refresh the links to the tables? Access caches meta data for the tables so it might be out of date. To be 100% sure delete the linked tables and relink them
Some experimentation led me to a solution to my problem:
Add a MouseUp-eventhandler to your bound checkbox with the following code:
Private Sub MyCheckbox_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.Recordset!MyField = Not Me.Recordset!MyField
End Sub
Now the crash doesn't occur. It seems like this way the assignment of a value is done correctly.
精彩评论