[AccessD] AXP and Error 3310

DWUTKA at marlow.com DWUTKA at marlow.com
Fri Aug 6 16:47:28 CDT 2004


Do you have a utility to count the number of threads being used?

Drew

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Jim Dettman
Sent: Friday, August 06, 2004 4:30 PM
To: Access Developers discussion and problem solving
Subject: RE: [AccessD] AXP and Error 3310


Drew,

  You can test that theory out; there is a registry setting for the number
of threads that JET should use.

Jim
(315) 699-3443
jimdettman at earthlink.net

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com]On Behalf Of
DWUTKA at marlow.com
Sent: Friday, August 06, 2004 5:17 PM
To: accessd at databaseadvisors.com
Subject: RE: [AccessD] AXP and Error 3310


Okay, did a little testing on my own, with Access 97.  Used the following
code:

Dim i
Do Until i=-1
	docmd.TransferText .......
	i=i+1
	Me.lblStatus.Caption="Importing: " & i
	'DoEvents
Loop

Now, as is, above, the code Kicked up an 2051 error when i=11593 (It had
imported 46372 records).  Stopping the code, compacting the database,
repairing the database, nothing would let the code start up again (without
immediately kicking up that error message....which said something along the
lines of a dialog box was not clicked or something.....), until I closed
Access, and opened it up again, then it started right back up.

Next time, it didn't error, it just hung.  It sat at a record level of
~120,000 for about ten minutes, then I just killed it.  No error, but it was
definitely failing.


Once I remove the quote before DoEvents, so that it would run, it seems to
just fly, with no stopping.  As I'm typing this, it's imported the records
1.5 million times and still going.

Here's my theory.  Jet is multi-threaded.  I've had a little experience with
multi-threading VB projects.  One thing I know with doing that, is you have
to be EXTREMELY careful when accessing a database.  In fact, it is almost
mandatory to force only one thread to do db transactions.  If two threads
try db transactions 'simultaneously', all sorts of things will happen (from
just losing the thread, all the way to corrupting the database....not
kidding...).  The reason is that Windows isn't really paying attention to
what a thread is doing when it gives time to the next one.  So if two
threads hit the db at the right time, it can REALLY get goofy.

I'm sure the developers had that in mind when creating the TransferText
method, however, they also probably didn't count on someone importing a file
over and over and over, without a break.  So what is probably happening, is
that you are getting 'thread lock', where one or more of Jet's threads are
locked, and there is nothing you can do about it, until you close Access,
which will release the Jet threads.  Now, I think putting in a DoEvents
simply let's the VBA pause long enough to let the Jet threads finish what
they need too, before being called again.

Hope this helps in someway.

Drew

P.S. (It's now at 1.78 mill and counting....with the DoEvents....)

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Charlotte
Foust
Sent: Thursday, August 05, 2004 4:49 PM
To: AccessD at databaseadvisors.com
Cc: Steve White
Subject: [AccessD] AXP and Error 3310


I'm beating my head against this and couldn't find anything in the
archives or the MSKB (they seem to never have heard of error 3310), so
I'm looking to you guys for assistance.  We have an app that does
nothing but watch a folder and import the files it finds there.  To
stress test it, we set it up with a single file (which is actually a zip
file containing a series of comma delimited text files, each compatible
with a table in the database structure) to import repeatedly.  The
import specs are there, and the thing behaves beautifully ... For a
while.  Then suddenly, after it has happily imported the same file
several hundred times, it loses its mind and starts throwing a 3310
error, "This property is not supported for external data sources or for
databases created with a previous version of Microsoft Jet" for each
text file in the archive.  Mind you, this is within 60 seconds of having
imported the thing before.

After that, NO imports are possible in the database, even from the UI
until you close and restart Access.  Nothing else has changed, and the
database is not overly large.  It isn't an unhandled error somewhere,
because the module level and global variables are still populated.  I
can open the unzipped text files and see the data in them, but Access
can no longer import it, not even from the UI.  I'm not getting an Out
of Memory error or anything else, but I can step through the code and
see it break on DoCmd.TransferText.  We're running on XP but I can
replicate the behavior on Win2k and it is fairly consistent across
machines with different speeds and memory, although the details of
*when* it breaks vary slightly.

I have a restart functionality built, shelling out to a restart app, but
I want to know what's going wrong, not just paste a bandage on it.  Has
anyone else every encountered (and overcome) this?

Charlotte Foust
Infostat Systems, Inc.
--
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
--
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com


-- 
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list