Article View: comp.databases.ms-access
Article #271Re: Problem with MS Jet 4.0
From: Plamen Petrov
Date: Fri, 05 Apr 2002 08:23
Date: Fri, 05 Apr 2002 08:23
94 lines
4172 bytes
4172 bytes
Thanks
It's enough to know that I can't do any more. I'm going to move the
creation of the referential constraint at the end of the batch, after the
transaction. This is an approximate solution, but it's enough for now.
Plamen
"Michel Walsh" <Vanderghast@msn.com> wrote in message
news:O$0RX882BHA.2848@tkmsftngp05...
> Hi,
>
>
> It is a Jet limitation. You can reproduce the same problem with the UI,
without transaction:
>
> Create t1. Open it in design mode and leave it like it is, in design mode.
>
> Try to create t2 with the reference constraint, you won't be able, since
t1 is already open with an
> EXCLUSIVE lock, Jet won't be able to open it to check the validity of the
implied fields through
> the constraint.
>
> In your case, it seems that locking a single record in t1 (through the
insert within a transaction)
> makes impossible to open the table t1 in an exclusive mode, thing that Jet
tries to do, to check
> the reference constraint involved in table2 creation:
>
> Put back t1 in edit mode (from the design view we left it), and start to
modify an existing record,
> BUT DO NOT SAVE the record, leave it dirty, next, try to create t2 (again,
without transaction
> involved). I used, in the immediate (debug) window, the statement (it is
one line) :
>
> CurrentDb.Execute "CREATE TABLE t2 (id AUTOINCREMENT NOT NULL
PRIMARY KEY, x INT NOT NULL
> REFERENCES t1(Id), name VARCHAR(50))"
>
>
> and I got the same error than you did.
>
> It is definitively a limitation about how Jet works when we create a
reference.
>
>
>
>
> Hoping it may help,
> Vanderghast, Access MVP
>
>
> "Plamen Petrov" <plamen.petrov@grutzeck.de> wrote in message
news:3cac01a5$1@news.grutzeck.local...
> > It's very easy to reproduce the problem.
> > Create a table using the next statement:
> >
> > CREATE TABLE t1
> > (
> > id AUTOINCREMENT NOT NULL PRIMARY KEY,
> > name VARCHAR(50)
> > )
> >
> > After that execute in transaction next 2 statements:
> >
> > INSERT INTO t1(name) VALUES('abc')
> >
> > CREATE TABLE t2
> > (
> > id AUTOINCREMENT NOT NULL PRIMARY KEY,
> > x INT NOT NULL REFERENCES t1(Id),
> > name VARCHAR(50)
> > )
> >
> > The result is error: 0x80040E14L - DB_E_ERRORSINCOMMAND
> > State : 3211
> > Native : -534316312
> >
> > The database engine could not lock table 't1' because it is already
> > in use by another person or process.
> >
> > The same code works with SQL Server. Is it a bug in Jet,
> > or I'm not doing it in the correct way?
> >
> >
> >
> >
> >
>
>
Technical Details
Message-ID:
<3cad5ef0$1@news.grutzeck.local>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!supernews.com!freenix!deine.net!newsfeed00.sul.t-online.de!t-online.de!tkmsftngp01!tkmsftngp04!news.grutzeck.localReferences:
<3cac01a5$1@news.grutzeck.local> <O$0RX882BHA.2848@tkmsftngp05>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111a5a,ea777802d348ae5c X-Google-Attributes: gid111a5a,public X-Google-Thread: 103569,ea777802d348ae5c X-Google-Attributes: gid103569,public X-Google-Thread: 1041a7,ea777802d348ae5c X-Google-Attributes: gid1041a7,public X-Google-Thread: ff0ac,ea777802d348ae5c X-Google-Attributes: gidff0ac,public X-Google-Thread: 109305,ea777802d348ae5c X-Google-Attributes: gid109305,public X-Google-Thread: 1143a6,ea777802d348ae5c X-Google-Attributes: gid1143a6,public X-Google-ArrivalTime: 2002-04-05 00:48:11 PST From: "Plamen Petrov" <plamen.petrov@grutzeck.de> References: <3cac01a5$1@news.grutzeck.local> <O$0RX882BHA.2848@tkmsftngp05> Subject: Re: Problem with MS Jet 4.0 Date: Fri, 5 Apr 2002 10:23:12 +0200 Lines: 96 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Original-NNTP-Posting-Host: 192.18.4.172 Message-ID: <3cad5ef0$1@news.grutzeck.local> X-Original-Trace: 5 Apr 2002 10:23:12 +0100, 192.18.4.172 Newsgroups: comp.databases.ms-access,es.comp.bd.ms-access,microsoft.public.access.dataaccess.pages,microsoft.public.access.tablesdbdesign,microsoft.public.data.oledb,microsoft.public.office.access.devtoolkits NNTP-Posting-Host: p5080c183.dip0.t-ipconnect.de 80.128.193.131 Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!supernews.com!freenix!deine.net!newsfeed00.sul.t-online.de!t-online.de!tkmsftngp01!tkmsftngp04!news.grutzeck.local