AddNew's Under Transaction

AddNew's Under Transaction

Post by Jacob Lewall » Mon, 19 Apr 1999 04:00:00



    I'm getting desperate. . .

    I have a fairly large transaction where I do many things, mainly
modifying records. Towards the end of the transaction I add two records
to two different databases. The databases are opened long before the
transaction is began. The recordsets in each of the databases are opened
in the transaction before the records are added to them. I close the RS
after calling Update on them. Here's the problem. The first record
addition works fine. The second record addition fails because of a
locking error. If I switch the additions around, the second fails. (The
second AddNew/Update pair always fails, no matter the order) If I move
one outside the CommitTrans() call, everything is fine. Anyone have any
ideas? If I step through, very slowly, it works. I'm assuming because a
timeout has a occured(I have set the two timeout values to 0 via
SetOption though. . .)

I GREATLY appreciate any help, thanks,
JL

 
 
 

AddNew's Under Transaction

Post by Jacob Lewall » Wed, 21 Apr 1999 04:00:00




Quote:>     I'm getting desperate. . .

        I was. I have solved my problem. . .

        The problem was, the databases were named the same, with a change
in the extension. (DATABASE.1) (DATABASE.2) for example. Whenever you
open a database, JET creates a .ldb file listings all the users and locks
you have. Because the file's were named the same, the LDB's ended up
"conflicting". I figured everything was allright because JET never
complained and that maybe it was just using the same file for both
databases. Well, turns out JET is stupid. And saw any locks/users in the
LDB file as applying to both databases. Changing the database names
resulted in no more locking errors.

        I came upon a nifty little program that lets you read the LDB
files and see locks and users manipulating it. . . it is. . . here.

http://support.microsoft.com/support/kb/articles/Q176/6/70.asp

Nifty program. I'm posting this as to help furthur generations from doing
what I did.

Thanks to. . .well. Whatever,

JL

 
 
 

1. Addnew Doesn't Addnew!

I have two forms with two data controls with sql recordsets on the same
table, one displays a dbgrid, the other data edit/entry for a single
record.  I can add new records in the first form and display and edit
them in the second form, but nothing will induce the second form to add,
even tho .addnew, .edit, and .update as well as save procedure produce
no errors.  Instead they simply overwrite the first of the records in
the recordset.  What's the matter - is this impossible?  If so, is there
a workaround?

2. How to Query

3. MultiUser Database DAO - 'Addnew'

4. SQL Server 7.0 Not using 2nd processor?

5. VB 6.0 DSN less connection to a text file

6. VC++ ADO Extensions - AddNew locks the table when in transaction

7. How to call a ORACLE stored procedure which parameters are PL/SQL table and %ROWTYPE

8. Repost: 'Update without AddNew or Edit' error message just after .AddNew

9. Can't Edit or AddNew in SQLServer

10. Can't get primary key value after recordset.AddNew

11. can't rs.addnew to persisted XML RS.

12. GUID and addNew - can't get back the GUID value