🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.databases.ms-access
Article #273

Re: Problem with MS Jet 4.0

#273
From: Michel Walsh
Date: Thu, 04 Apr 2002 11:53
69 lines
3572 bytes
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: <O$0RX882BHA.2848@tkmsftngp05>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!supernews.com!newsfeed.online.be!newsfeed.vmunix.org!newsfeed01.sul.t-online.de!newsfeed00.sul.t-online.de!t-online.de!tkmsftngp01!tkmsftngp05
References: <3cac01a5$1@news.grutzeck.local>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1041a7,ea777802d348ae5c
X-Google-Attributes: gid1041a7,public
X-Google-Thread: 111a5a,ea777802d348ae5c
X-Google-Attributes: gid111a5a,public
X-Google-Thread: 103569,ea777802d348ae5c
X-Google-Attributes: gid103569,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-04 03:56:17 PST
From: "Michel Walsh" <Vanderghast@msn.com>
References: <3cac01a5$1@news.grutzeck.local>
Subject: Re: Problem with MS Jet 4.0
Date: Thu, 4 Apr 2002 06:53:41 -0500
Lines: 71
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
Message-ID: <O$0RX882BHA.2848@tkmsftngp05>
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: mon-pq68-142.netcom.ca 216.123.142.78
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!supernews.com!newsfeed.online.be!newsfeed.vmunix.org!newsfeed01.sul.t-online.de!newsfeed00.sul.t-online.de!t-online.de!tkmsftngp01!tkmsftngp05