MDAC 2.1 and DAO: Problem with Boolean fields.

MDAC 2.1 and DAO: Problem with Boolean fields.

Post by Bill Grunna » Thu, 17 Jun 1999 04:00:00



I seem to have come across a very * bug in MDAC 2.1 when using DAO. If
you do an AddNew and set a boolean field to True, that field is not saved.
The problem only happens when you do an AddNew; editing an existing record
works properly. I have replicated the problem on multiple machines using
VB6. I'm curious if anyone else has run across this (or can point out some
really stupid flaw in my code <g>).

The following demonstrates the problem:
    Set db = ws.OpenDatabase("signup", dbDriverNoPrompt, False, "ODBC;")
    Set rs = db.OpenRecordset("tblTest", dbOpenDynamic, 0, dbOptimistic)
    rs.AddNew
    rs("TextField") = "Test"
    rs("BooleanField") = True
    rs.Update
    rs.Bookmark = rs.LastModified
    Debug.Print rs("TextField")
    Debug.Print rs("BooleanField")
    rs.Close

This should display:
    Test
    True
But instead displays:
    Test
    False

However the following works as expected:
    Set rs = db.OpenRecordset("tblTest", dbOpenDynamic, 0, dbOptimistic)
    rs.AddNew
    rs("TextField") = "Test"
    rs.Update
    rs.Bookmark = rs.LastModified
    rs.Edit
    rs("BooleanField") = True
    rs.Update
    Debug.Print rs("TextField")
    Debug.Print rs("BooleanField")
    rs.Close

Any comments?

Bill Grunnah
TekSolutions

 
 
 

1. VB6 SP3 Install Problem DAO and MDAC 2.1 (URGENT)

Hi All,

    I'm realy sorry about my mail that goes to news groups except
"microsoft.public.vb.setupwiz". But my problem is very strange. We wrote a
large program in VB5 SP3. Before we deploy it to our customers. We decide to
convert it VB6 (SP3) becouse, we have to use ADO on our next project. (We
can't use VB5 with VB6 on the same machine, I wonder if it's possible also.)
We recompile our project in VB6 but when we try to install it to a WIN95
machine. The Install says " Setup will upgrade the machine" OK no problem
but it's not upgrade it. On other machine WIN 98 an Error raises with a code
number and it crashes. We try to build lot's of package  some of them was 6
Cabs, some of them was 9-10 cabs including mdac2.1. We're going to be crazy
with this deployment wizard. We're unable to install any package. I've
changed the references of the program to DAO 3.6 . Every time we just have
is unsuccess. At the readme of the SP3 says "you must use the mdac set at
the VB6 CD's. But I don't understand it also becouse our program only uses
DAO for Data Access.

Program uses DAO 3.51, Sheridian Data Widgets 3.01, Crystal Report 4.6
Any Help is  needed

Please reply it to my E-Mail also becouse it's very urgent ( if possible)
Thanks...

2. Oracle ODBC error

3. MDAC 2.6 on the Server and MDAC 2.1 on the Client - Big Problems

4. cdml and uploading files

5. Decimal data type problem

6. Printing in VB

7. DAO 3.6, Mdac 2.0 or 2.1?

8. ODBC Drive returns records using MDAC 2.0 but not MDAC 2.1 SP 2

9. MDAC 2.1 (GA) and MDAC 2.5 (RTM)

10. MDAC 2.1 vs MDAC 2.5?

11. MDAC 2.1 to MDAC 2.0