Bug #3683 Access ADO Recordset and Unsigned Fields
Submitted: 6 May 2004 22:23 Modified: 29 May 2013 13:12
Reporter: Bradley Rowe Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / ODBC Severity:S3 (Non-critical)
Version:3.51.06 OS:Windows (Windows XP)
Assigned to: Assigned Account CPU Architecture:Any
Tags: ODBC5-RC

[6 May 2004 22:23] Bradley Rowe
Description:
When binding a form in Access to an ADO recordset, text boxes bound to unsigned smallint, mediumint, and int fields (we already know about bigint issues) will display garbage characters. 

Curiously, this issue does not appear when using linked tables in Access.

How to repeat:
1. Create a form in Access 2000, 2002, or 2003.
2. Open the VB editor.
3. Create a textbox bound to an unsigned int field.
4. Create an ADO connection object.

    Dim conn As ADODB.Connection
    Set conn = New ADODB.Connection
    
    With conn
        .ConnectionString = "DRIVER=" & strDriver _
                            & ";SERVER=" & strServer _
                            & ";DATABASE=" & strDataBase _
                            & ";UID=" & strUsername _
                            & ";PWD=" & strPassword _
                            & ";OPTION=3"
        .Open
    End With

5. Open the recordset and bind it to the form. (in my case, placed
in the OnOpen event property)

      Dim rs As ADODB.Recordset
            
      'Create an instance of the ADO Recordset class,
      'and set its properties
      Set rs = New ADODB.Recordset
      
      With rs
         Set .ActiveConnection = conn
         .Source = "SELECT <unsigned int field> FROM <MyISAM table>"
         .LockType = adLockOptimistic
         .CursorType = adOpenKeyset
         .CursorLocation = adUseClient
         .Open
      End With
      'Set the form's Recordset property to the ADO recordset
      Set Me.Recordset = rs
      Set rs = Nothing
      Set conn = Nothing

Suggested fix:
Add support for unsigned integers on ADO recordsets.

--- Temporary Workarounds ---
1. For fields that do not need to be edited: CAST(<offending field> AS CHAR) in SELECT statement.

2. Use only SIGNED ints for fields that require editing.
[11 Aug 2004 2:55] Reggie Burnett
Has this ever worked?  Access uses VBA which does not like unsigned values.  The value of the field is coming through but it is being displayed as a character.  I'm thinking the problem here is in how Access is handling the data once it gets to access.  You can set a breakpoint in Access and inspect the field objects as you walk them and you'll see that the correct values from the columns are there but they don't display properly.

Please let me know what else you know about this and what you have done, if anything, to make it work or work around.
[14 Feb 2005 22:54] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[29 May 2013 13:12] Bogdan Degtyariov
I'm closing this bug because I can not continue without feedback from the reporter. If you have new info, please reopen the report.