FIX: Access Bit Fields and MDAC 2.1ID: Q221184
|
When inserting data into a Bit (Yes/No) field in a Microsoft Access database via the Microsoft Access ODBC driver, the resulting data in the bit field is always False, even when a value of True was specified.
This behavior occurs when using the Microsoft Access/Jet ODBC driver provided with MDAC 2.1, version 4.0.3513.
The Microsoft Access ODBC driver (Odbcjt32.dll) is incorrectly using 2 bytes rather than a single byte when calculating the offset to the data for the bit field. This offset does not contain the correct value, and the data is inserted into the database as False.
Acquire the hotfix version of the Microsoft Access ODBC driver that addresses this problem.
A supported fix that corrects this problem is now available from Microsoft, but
it has not been fully regression tested and should be applied only to systems
experiencing this specific problem. If you are not severely affected by this
specific problem, Microsoft recommends that you wait for the next
that contains this fix.
To resolve this problem immediately, contact Microsoft Product Support Services
to obtain the fix. For a complete list of Microsoft Product Support Services
phone numbers and information on support costs, please go to the following
address on the World Wide Web:
http://www.microsoft.com/support/supportnet/overview/overview.asp
Date Time Version Size File name Platform
---------------------------------------------------------
03/18/99 4.0.3918.0 301KB Odbcjt32.dll
Dim szSQL$
Dim rdorst As rdoResultset
'Initialize the Environment.
rdoEngine.rdoDefaultCursorDriver = rdUseServer
Set mrdoEnv = rdoEngine.rdoCreateEnvironment("TrueFalseTest", "", "")
mrdoEnv.UserName = "admin"
Set mrdoConn = mrdoEnv.OpenConnection(DSName:="Northwind", Prompt:=rdDriverComplete, _
ReadOnly:=False, Connect:="pwd=;")
mrdoConn.QueryTimeout = 60
mbConnOpen = True
szSQL = "Create table TrueFalse(Check1 bit, Check2 bit)"
mrdoConn.Execute szSQL
szSQL = "SELECT * FROM TrueFalse"
Set rdorst = mrdoConn.OpenResultset(szSQL, rdOpenKeyset, rdConcurRowVer)
rdorst.AddNew
rdorst!Check1 = True
rdorst!Check2 = True
rdorst.Update
rdorst.Close
Additional query words: bit field false odbcjt32.dll access insert incorrect MDAC 2.1 Jet
Keywords : kbADO201fix kbDatabase kbDriver kbJET kbMDAC kbODBC210fix odbcAccess
Version : WINDOWS:2.1
Platform : WINDOWS
Issue type : kbbug
Last Reviewed: July 2, 1999