473,322 Members | 1,417 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Crash on acOutputTable

XP system. Access2002 (10.6501.6714) SP3. VBA 6.3

Access has been crashing at a certain point in code execution.

Code extract>>
Clear the old records from this table which is a temporary table for
the records which are used for merging in Word.
cnn.Execute "DELETE * FROM tblReadersLicences;"

rst.Open "SELECT * FROM tblReadersLicences", cnn, adOpenKeyset,
adLockPessimistic
rst.AddNew
rst!code = strCode
other fields filled….
rst!SpellSchemeMonth = strSchememonth
rst!SpellSchemeYear = strSchemeyear
rst.Update
rst.Close
The next line causes the system to pause for a given period.
TimerInterval of 4000 works, whereas 3000 does not. This is used to
stop the output file containing the data that was in the table before
it was substituted. Access seems to require a considerable time for
the new records to become assimilated.
DoCmd.OpenForm "frmPrintReport", acNormal, , , , acDialog, "Printing
Licence"

DoCmd.OutputTo acOutputTable, "tblReadersLicences", acFormatRTF,
strRTFFolder & "\Licences.rtf", False
The system crashes on executing the above line, unless the pause time
is extended sufficiently.

Is this a known phenomenon? If so, is there a surer way of avoiding
it?
Nov 13 '05 #1
7 2663
First, verify that rst is Dim'ed as a DAO.Recordset. If not, I would expect
problems prior to where you're having them, but it won't hurt to check.

There is a command you can use to give Access the time to write everything
to disk.

DBEngine.Idle dbRefreshCache

--
Wayne Morgan
Microsoft Access MVP
"tom blower" <to*******@tiscali.co.uk> wrote in message
news:91**************************@posting.google.c om...
XP system. Access2002 (10.6501.6714) SP3. VBA 6.3

Access has been crashing at a certain point in code execution.

Code extract>>
Clear the old records from this table which is a temporary table for
the records which are used for merging in Word.
cnn.Execute "DELETE * FROM tblReadersLicences;"

rst.Open "SELECT * FROM tblReadersLicences", cnn, adOpenKeyset,
adLockPessimistic
rst.AddNew
rst!code = strCode
other fields filled..
rst!SpellSchemeMonth = strSchememonth
rst!SpellSchemeYear = strSchemeyear
rst.Update
rst.Close
The next line causes the system to pause for a given period.
TimerInterval of 4000 works, whereas 3000 does not. This is used to
stop the output file containing the data that was in the table before
it was substituted. Access seems to require a considerable time for
the new records to become assimilated.
DoCmd.OpenForm "frmPrintReport", acNormal, , , , acDialog, "Printing
Licence"

DoCmd.OutputTo acOutputTable, "tblReadersLicences", acFormatRTF,
strRTFFolder & "\Licences.rtf", False
The system crashes on executing the above line, unless the pause time
is extended sufficiently.

Is this a known phenomenon? If so, is there a surer way of avoiding
it?

Nov 13 '05 #2
There is nothing in the *posted* ADO code that should cause a problem or any
sort of delay, unless you are experiencing some unknown conflict with
pessimistic locking (simply switching to optimistic locking will eliminate
that possibiltiy). Unless you are operating over a WAN or a very slow LAN,
there should be no delay whatsoever, that you would need:
This is used to
stop the output file containing the data that was in the table before
it was substituted.
Are you using CurrentProject.Connection? If you are not, the delay could be
caused by unneccesarily creating a new connection. In short, this
statement:
Access seems to require a considerable time for
the new records to become assimilated.
is not *normally* correct.

Could you post the *entire* ADO code for deleting/filling this table?
Darryl Kerkeslager

"tom blower" <to*******@tiscali.co.uk> wrote: Access has been crashing at a certain point in code execution.
rst.Open "SELECT * FROM tblReadersLicences", cnn, adOpenKeyset,
adLockPessimistic
rst.AddNew
rst!code = strCode [snip]
The next line causes the system to pause for a given period.
TimerInterval of 4000 works, whereas 3000 does not. This is used to
stop the output file containing the data that was in the table before
it was substituted. Access seems to require a considerable time for
the new records to become assimilated.

Nov 13 '05 #3
Disregard the previous if you're using ADO. ADO does have a Flush method to
force a write, but the help file says that Flush is done automatically when
you do a Close.

Where is the table located that you are writing to? If it is across a
network, could there be a network problem? What happens if, in addition to
closing the recordset, you close or close and reopen the connection before
you do the acOutputTable?

--
Wayne Morgan
MS Access MVP
"Wayne Morgan" <co***************************@hotmail.com> wrote in message
news:d_****************@newssvr31.news.prodigy.com ...
First, verify that rst is Dim'ed as a DAO.Recordset. If not, I would
expect problems prior to where you're having them, but it won't hurt to
check.

There is a command you can use to give Access the time to write everything
to disk.

DBEngine.Idle dbRefreshCache

--
Wayne Morgan
Microsoft Access MVP

Nov 13 '05 #4
Thanks for the helpful comments.

I do not think it is a LAN problem as I am coding standalone and the
crashes occur here. I have (as suggested) changed to using optimistic
locking and not only does that seem to prevent the output "ignoring"
the new record(s), but did not cause the crash either. I shall run
with this for a while and report back.

Darryl
This is the full sequence of settings for establishing the recordset.

Dim cnn As ADODB.Connection
Dim rst As ADODB.Recordset
------
Set cnn = New ADODB.Connection
cnn.Open CurrentProject.Connection
------
' Delete record(s)
cnn.Execute "DELETE * FROM tblReadersLicences;"

‘ Now prime the pump!
rst.Open "SELECT * FROM tblReadersLicences", cnn, adOpenKeyset,
adLockPessimistic
rst.AddNew
other fields covered
rst.Update
rst.Close

Form pauses system
DoCmd.OpenForm "frmPrintReport", acNormal, , , , acDialog, "Printing
Licence"

DoCmd.OutputTo acOutputTable, "tblReadersLicences", acFormatRTF,
strRTFFolder & "\Licences.rtf", False
Nov 13 '05 #5
Since my last comment, the crashes have re-occurred. The only way I
could stop it was to compact and repair, when it ran OK one time and
then reverted. I then tried to create a new databse and import, but
that failed halfway.
I then decided to uninstall OfficeXP, defragged the disk and
reinstalled.
I have not yet installed any updates, but Access crashed again.

Any ideas? It is getting a bit desperate.
Nov 13 '05 #6
I assume that you are not running the particular code you posted when it
crashes?

Here is the only problem I see in the code you posted. I don't know whether
it would cause an Access crash or not.

Replace:

Set cnn = New ADODB.Connection
cnn.Open CurrentProject.Connection

With:

Set cnn = CurrentProject.Connection
If that does not fix the problem, or if your problems are occurring even
when you don't run the code you posted, then there is something else going
wrong other than the code you posted. Re-post the complete description of
the problem, and test with the most basic mdb that crashes, and describe
exactly what happens ('crashes' is too vague). Someone will know what the
problem is in this newsgroup, but the more specific you can be, including
version number, service pack, and the steps you take, and the more basic the
mdb, the better chance of getting the answer on your first post.
Darryl Kerkeslager
"tom blower" <to*******@tiscali.co.uk> wrote in message
news:91**************************@posting.google.c om...
Since my last comment, the crashes have re-occurred. The only way I
could stop it was to compact and repair, when it ran OK one time and
then reverted. I then tried to create a new databse and import, but
that failed halfway.
I then decided to uninstall OfficeXP, defragged the disk and
reinstalled.
I have not yet installed any updates, but Access crashed again.

Any ideas? It is getting a bit desperate.

Nov 13 '05 #7
I will try your amendment. Actually, I did give the version no etc in
my first message.

In any event, I have cracked it!

I put a break on the line of acOutputTable and then pressed F8 and
there was never a crash (Access closed, I now have 13 backups,
although the MS error reporting did not always appear). If I restarted
the code, I got a crash.

As the crashes always occurred at the point where the table was being
output, the output ticker at the bottom of the screen had started, I
took a look at the table being output. There were a number of
redundant fields, so I copied the table, deleted those fields and
using the new table the beauty has not crashed since. Fingers crossed!
I may say that I have been outputting tables for ever using virtually
the same code, but with other tables.

One of the fields lost was a memo field, but I have that elsewhere
with no problem. I will test further to see if there was some
corruption in the original table and report.

Thanks
Nov 13 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

48
by: Joseph | last post by:
Hi I'm writing a commercial program which must be reliable. It has to do some basic reading and writing to and from files on the hard disk, and also to a floppy. I have foreseen a potential...
8
by: Eric Brunel | last post by:
Hi all, I was creating a Tkinter widget in the style of the reversed tabs below Excel worksheets and I stepped in a serious problem: the code I made makes python crash with a seg fault, bus...
0
by: roni | last post by:
hi. i have application written in vb.net + managed c++ dll that call also to unmanaged c++ function. the application crash. i open the dump file of the crash with WinDbg and that's is the...
10
by: xixi | last post by:
i have db2 udb v8.1 on windows 64 bit 2003 server, after db2 server start , i found this in the db2diag.log, is this error? 2004-05-05-15.28.30.780000 Instance:DB2 Node:000...
9
by: tomblower | last post by:
Access 2000 fully updated Three PCs manage data held on a server. They each have a front-end mdb file linked to tables on the server and on each PC. A problem has arisen over the following line...
34
by: NewToCPP | last post by:
Hi, Why does a C/C++ programs crash? When there is access to a null pointer or some thing like that programs crash, but why do they crash? Thanks.
12
by: benjamin.krulewitch | last post by:
I'm debugging an issue with a C program that causes the computer to crash, and I'm attempting to log information immediately before the crash occurs. I us my BKprintLog function (see below) to...
110
by: alf | last post by:
Hi, is it possible that due to OS crash or mysql itself crash or some e.g. SCSI failure to lose all the data stored in the table (let's say million of 1KB rows). In other words what is the worst...
11
by: =?Utf-8?B?R2VyaGFyZA==?= | last post by:
I have run into a situation that if a page/tab that uses the Ajax toolkit (using .net version 3.5) is closed before the Ajax enable controls complete loading, then IE locks up. Does it in both IE7...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.