473,549 Members | 2,784 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

acOutputTable - cannot save output data

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 of code.
DoCmd.OutputTo acOutputTable, "tblMarriageLic ence", acFormatRTF, strRTFFolder & "\Marlicm.r tf", False


The linked table has just been updated and is held in another MDB file
on the local PC. The target folder is on the local PC. As you can see,
the file name is always the same, so the existing file is being
overwritten. This line of code has worked in numerous locations and in
this particular one without ever failing until all three PCs in this
location start getting error messages last Friday!

Error 2303 - Cannot save output data to the file you selected.
Error 2308 - File already exists, Marlicm.rtf

One assumes a locking problem. There should be no question of rights or
permissions as all the files affected are on each local PC. After the
error, it is impossible to delete the RTF file "in use by another
user". Close Access and it can be deleted.

The procedure now works - ONE TIME - the file was not there to be
overwritten.

I am not aware of any change having been made. The front-end
application mdbs were updated on the Tuesday and everything worked fine
as usual until the Friday.

What is very strange, is that another routine in the same form module,
using exactly the same line of code, but with another file name -
same location of files overwriting the RTF file - still works. That
RTF file was copied and renamed as the problem file, but the same error
occurred.

Another form module has the same problem.

Can anyone point to a solution - other than deleting the RFT file
before running the code - which is really ham-fisted?

Thanks

Jan 29 '06 #1
9 5046
<to*******@tisc ali.co.uk> wrote in message
news:11******** *************@o 13g2000cwo.goog legroups.com...
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 of code.
DoCmd.OutputTo acOutputTable, "tblMarriageLic ence", acFormatRTF,
strRTFFolder & "\Marlicm.r tf", False


The linked table has just been updated and is held in another MDB file
on the local PC. The target folder is on the local PC. As you can see,
the file name is always the same, so the existing file is being
overwritten. This line of code has worked in numerous locations and in
this particular one without ever failing until all three PCs in this
location start getting error messages last Friday!

Error 2303 - Cannot save output data to the file you selected.
Error 2308 - File already exists, Marlicm.rtf

One assumes a locking problem. There should be no question of rights or
permissions as all the files affected are on each local PC. After the
error, it is impossible to delete the RTF file "in use by another
user". Close Access and it can be deleted.

The procedure now works - ONE TIME - the file was not there to be
overwritten.

I am not aware of any change having been made. The front-end
application mdbs were updated on the Tuesday and everything worked fine
as usual until the Friday.

What is very strange, is that another routine in the same form module,
using exactly the same line of code, but with another file name -
same location of files overwriting the RTF file - still works. That
RTF file was copied and renamed as the problem file, but the same error
occurred.

Another form module has the same problem.

Can anyone point to a solution - other than deleting the RFT file
before running the code - which is really ham-fisted?

Thanks


I don't see why deleting the file first would be such a bad idea - if this
produced an error it might help you diagnose the problem. Having said that,
if the problems suddenly started to occur one particular Friday, then I
would investigate possible corruption in the table which might be causing
this. Does this table have 1 or more memo fields? Try a compact and repair
of the back end first or try changing the code to output another table
(ideally a small lookup table with no memo fields) but use the same file
location - does this produce the same error?

Jan 29 '06 #2
Thanks Anthony.
I will try what you suggest. I was concerned that deleting the file
first was impracticable, since it was locked whilst Access was running
and the user would have to unload Access each time before the delete,
which would mean continuous loading and unloading. Anyway - why go to
that solution when the thing has been working perfectly satisfactorily
for years. That fact alone would point to your line of thinking.

Jan 30 '06 #3
There are no memo fields. Other RTF files are output successfully to
the same location. I have the table here and there is nothing wrong
with it.
Compact & repair did not solve the issue. Access succeeds in creating a
RTF file, but the file remains locked until Access is closed. I now
have the RTF file created by the user here and I am unable to link it
to a merge document, nor open it in Word. The Word message says
"Document name or path is not valid - check file permissions". I am
working as adminstrator on this PC, so I cannot think there are
problems with permissions.
What is happening is that even if the file is deleted first with Access
closed and then the Access procedure is run, the file is created but
locked so that Access then says it cannot proceed to output the data. I
cannot see what is in the file, so I do not know whether it contains
any data.
The procedure works OK for me here.
As the problem arises with one particular Access form I can only think
there is a problem there. What is odd is that more than one user has
the problem and they all have exactly the same mdb file on their PCs as
the front-end application.
So I am stuck again.
Any ideas?

Jan 30 '06 #4
<to*******@tisc ali.co.uk> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.com.. .
There are no memo fields. Other RTF files are output successfully to
the same location. I have the table here and there is nothing wrong
with it.
Compact & repair did not solve the issue. Access succeeds in creating a
RTF file, but the file remains locked until Access is closed. I now
have the RTF file created by the user here and I am unable to link it
to a merge document, nor open it in Word. The Word message says
"Document name or path is not valid - check file permissions". I am
working as adminstrator on this PC, so I cannot think there are
problems with permissions.
What is happening is that even if the file is deleted first with Access
closed and then the Access procedure is run, the file is created but
locked so that Access then says it cannot proceed to output the data. I
cannot see what is in the file, so I do not know whether it contains
any data.
The procedure works OK for me here.
As the problem arises with one particular Access form I can only think
there is a problem there. What is odd is that more than one user has
the problem and they all have exactly the same mdb file on their PCs as
the front-end application.
So I am stuck again.
Any ideas?

The code works flawlessly on my machine. I did a quick Google on
"DoCmd.Outp utTo fails" and see various things mentioned like registry
settings ... but when it occurs on multiple machines it seems unlikely.
Perhaps you could have a search and see if anything sounds possible. If
other tables can be output, but not this one, then I wonder what is special
about this one. Perhaps it is specially big?
Perhaps someone else is following this thread but I am out of ideas. Of
course you could write your own routine to output the file and bypass the
docmd method entirely but it might be tricky to do the rtf format and may
end up being slower than the built-in method.
Jan 30 '06 #5
Perhaps, the files ReadOnly attribute has been set.

You might try the following to see if it helps.

On Error Resume Next
SetAttr strRTFFolder & "\Marlicm.r tf", GetAttr(strRTFF older &
"\Marlicm.r tf") And Not vbReadOnly
On Error GoTo 0
DoCmd.OutputTo acOutputTable, "tblMarriageLic ence", acFormatRTF,
strRTFFolder & "\Marlicm.r tf", False

or
SetAttr strRTFFolder & "\Marlicm.r tf", vbNormal

Jan 30 '06 #6
Thanks for the input. I spent the best part of a day on site trying to
get to the bottom of the problem.

The problems all arise from the one table. Records in this table are
deleted and then a fresh record is added, with data from the main
database held on the server. That record is then output to RTF file.
The table being putput and the RTF file are both on the local PC. What
is happening is that the export does not finish, leaving the file
effectively open, so that when it comes to the Word merge using that
RTF file, Word cannot open it etc etc. Moreover the data in the file is
not always correct with some fields showing #error. I tried exporting
the table using the export function in the right-click menu and got the
same result. The problem is intermittent, which adds to the gloom!

I then re-created the table from scratch. After a few successes the
same problem arose.

I discovered that one PC has a later version of Access2000, (9.0.6926
SP-3), and the problem does not occur on that PC. The other two have
9.0.3821 SR-1. I will get them updated as that may well be the cause of
the trouble. What really foxes me is that this routine has been used
for about 5 years on various sites and never before has this problem
occurred.

Could it be worth re-creating the bound form where the data input is
made, or the query underlying the form? The table with the data files
has 37 fields and the file being exported has 54 fields.

Feb 2 '06 #7

<to*******@tisc ali.co.uk> wrote in message
news:11******** *************@o 13g2000cwo.goog legroups.com...
Thanks for the input. I spent the best part of a day on site trying to
get to the bottom of the problem.

The problems all arise from the one table. Records in this table are
deleted and then a fresh record is added, with data from the main
database held on the server. That record is then output to RTF file.
The table being putput and the RTF file are both on the local PC. What
is happening is that the export does not finish, leaving the file
effectively open, so that when it comes to the Word merge using that
RTF file, Word cannot open it etc etc. Moreover the data in the file is
not always correct with some fields showing #error. I tried exporting
the table using the export function in the right-click menu and got the
same result. The problem is intermittent, which adds to the gloom!

I then re-created the table from scratch. After a few successes the
same problem arose.

I discovered that one PC has a later version of Access2000, (9.0.6926
SP-3), and the problem does not occur on that PC. The other two have
9.0.3821 SR-1. I will get them updated as that may well be the cause of
the trouble. What really foxes me is that this routine has been used
for about 5 years on various sites and never before has this problem
occurred.

Could it be worth re-creating the bound form where the data input is
made, or the query underlying the form? The table with the data files
has 37 fields and the file being exported has 54 fields.

Just a quick thought:
If it has suddenly started happening, then what could have changed? We
previously discussed corruption and that was ruled out - but you can get
problems when the data changes (without it being corrupt). I recently got
called in to troubleshoot a problem where reports had weirdly stopped
printing and it turned out that it was trying to keep the data on one page
but since the database had been set up, the data now had quite long memo
fields which couldn't be printed on one page. Access got stuck in a
perpetual loop each time moving to a page to see if it had enough room to
print the section - which it never did.
The point I am making is that it might be possible that the data has 'funny
characters' in it which is stopping the DoCmd.OutputTo from working
properly. Could you imagine taking a copy of the data, deleting all the
records, then adding some very standard entries and re-trying the code? In
this way, you might be able to narrow down the cause of this problem.

Feb 3 '06 #8
Anthony England wrote:
The point I am making is that it might be possible that the data has 'funny
characters' in it which is stopping the DoCmd.OutputTo from working
properly.


You think he has some unfortunate person named George Bush in his db?

---------

Today, China ... Tomorrow, the World!

Feb 3 '06 #9
"Lyle Fairfield" <ly***********@ aim.com> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.com.. .
Anthony England wrote:
The point I am making is that it might be possible that the data has
'funny
characters' in it which is stopping the DoCmd.OutputTo from working
properly.


You think he has some unfortunate person named George Bush in his db?

---------

Today, China ... Tomorrow, the World!

Dan Quale counts as a 'funny character' (apparantly Mikey Mouse wears a Dan
Quale watch) - however I'm not sure Bush qualifies.
Feb 3 '06 #10

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

Similar topics

6
10316
by: Christopher Brandsdal | last post by:
Hi! I get an error when I run my code Is there any other way to get te information from my form? Heres the error I get and the code beneath. Line 120 is market with ''''''''''''Line 120''''''''''''''''''''' ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
8
5456
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- Hello, I have a very simple problem but cannot seem to figure it out. I have a very simple php script that sends a test email to myself. When I...
7
2679
by: tom blower | last post by:
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",...
0
2812
by: acharyaks | last post by:
Hi life saver, I am using excel component for the development. The purpose is to connect to excel through the odbc connection string. Then through the connection extract data into a dataset and then save the data into a client machine (Intranet) as excel page using the excel component (using Excel = Microsoft.Office.Interop.Excel;) in the...
6
10655
by: Aaron Smith | last post by:
Ok. I have a dataset that has multiple tables in it. In one of the child tables, I have a column that I added to the DataSet (Not in the DataSource). This column does not need to be stored in the data on the datasource. It simply gets the first name and last name of an instructor and displays it in the grid. I have two major problems.... One,...
1
6781
by: liuliuliu | last post by:
hi -- sorry if this is trivial -- but how do you make a screenshot of a pygame display? i have a surface which is basically the entire visible screen -- how do you write this surface as an image file during specific events in the script execution? image format doesnt matter. thanks! christine
14
3423
by: fdu.xiaojf | last post by:
Hi, I have a program which will continue to run for several days. When it is running, I can't do anything except waiting because it takes over most of the CUP time. Is it possible that the program can save all running data to a file when I want it to stop, and can reload the data and continue to run from where it stops when the computer...
8
2385
by: mcserret | last post by:
I know this is a recurring problem that has been addressed here before, but even after reading all that has gone before, I am still stumped. I have a form that is designed to send data to a PHP page where is is to be validated then read into a MySQL table. Once that is done, the form is to send the user either back to the originating page,...
3
4341
by: evenlater | last post by:
I have an Access application on a terminal server. Sometimes my users need to export reports to pdf, rtf or xls files and save them to their own client device hard drives. They can do that right now the way I have this set up, but it's confusing and slow. When they browse for a place to save the reports, they see all of the drives on the...
0
7956
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7469
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6040
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5368
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5087
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3498
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3480
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1935
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
757
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.