ADDNEW in a Table (difference with Vista)

M

Max-EC

I have a VB6 apps that use an old MDB (Access 2.0 [1993]) with DAO 3.51

With XP all run perfect, but with Vista I have this problem:

when I insert many records in a table with a recordset opne in "Table" mode,
just after I call "AddNew" method into the fields I find yet the value I
insert in the previous record instead an empty value (or the default value).
Worst, when I call Update method those value is write down into the table.
Obviously the problem is visible only when some fields is not filled.

I try with a test program, and I get same result in interpreted mode (VB6),
but the compiled version seem run OK also in Vista. My original application
instead have the problem also compiled.

Here is the test code:

Private Sub Form_Load()

Dim dbFile As Database
Dim recTable As Recordset

Set dbFile = OpenDatabase(App.Path & "\DbAddNew.mdb")

Set recTable = dbFile.OpenRecordset("Table", dbOpenTable)
recTable.Index = "PrimaryKey" 'ID

dbFile.Execute "DELETE FROM
"

'first record
recTable.AddNew
recTable("ID") = 1
recTable("Field1") = "A"
recTable("Field2") = "B"
recTable("Test1") = "HHHH"
recTable("Test2") = "KKKK"
recTable.Update

'second record
recTable.AddNew
recTable("ID") = 2
recTable("Field1") = "CC"
recTable("Field2") = "DD"

'don't fill the filed TEST1, I expect empty
MsgBox "" & recTable("Test1")

recTable.Update

recTable.Close
dbFile.Close

End Sub

With Vista the messagge box show 'HHHH', with XP show empty

Anybody have an idea how to solve the problem (obviously without rewrite the
apps) or why those happen ?
Furthermore if the problem is due to Vista, DAO or Access 2.0 format ?

Tanks for your patience
Massimo
 
F

Fred

I know less than you about these specifics but a lot about running a small
company (18 PC's) dealing with such Microsoft problems. Maybe this
combination of smartness and dumbness is right to give some good advice.

Why don't you:

- Upgrade your Vista to XP
- Update your Access / Office to 2000 or 2003

Those make a solid combo with few of the "Microsoft has now lost their way"
problems.
 
M

Max-EC

Why don't you: ...

Thanks for your help Fred, BUT this applications is used by thousand of
user, I can't suggest any final user to downgrade to XP, and the database is
user from many year so I can't pretend from the user to upgrade any job
already done
 
F

Fred

Sorry, I did not know that. And then sorry that I can't help.

You have the tough situation a very old applications running on a new OS
that does a bad job of running even new applications.

BTW, I would call a change from Vista to XP to clearly be an UPgrade. :)
Vista is just a pile of roadblocks, bloat and problems for it's users which
is part of why it flopped.

Sincerely,

Fred
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top