I have an SQL Server 2005 database with a table that contains a field set as type varchar(8000). I am running a Microsoft Access 2003 front-end application which reads the database, using DAO. One function in the FE opens a snapshot type of DAO.Recorset to read this table, and here's where it gets weird:
The bug has to do with repeated reads of this field on the same record. If I attempt the following piece of code, here is what happens:
My program requires populating three variables with the field value. So, my short term solution is to set a placeholder variant with the field value, then fill the three variables from the placeholder variant.
Has anyone else come across this bug?
The bug has to do with repeated reads of this field on the same record. If I attempt the following piece of code, here is what happens:
Code:
Dim rs As DAO.Recordset
' cn: a DAO Connection through an ODBCDirect Workspace
' to the SQL Server Database
Set rs = cn.OpenRecordset("SELECT T1.MyField FROM Mytable AS T1", dbOpenSnapshot)
' The first time, the program returns the value
Debug.Print rs.Fields("MyField").Value
' The second time, and any successive times,
' the program returns Null
Debug.Print rs.Fields("MyField").Value
' NOTE: This is without moving to any other records
rs.Close
Set rs = Nothing
My program requires populating three variables with the field value. So, my short term solution is to set a placeholder variant with the field value, then fill the three variables from the placeholder variant.
Has anyone else come across this bug?