Exporting Data

  • Thread starter Jules Harris via AccessMonster.com
  • Start date
J

Jules Harris via AccessMonster.com

I have a problem in that if i use the following expression to export data:

DoCmd.TransferText acExportDelim, "BKALLEXPT", "BACKLOADALL", "\AT2000\
EXPORT.DAT"

I get an error which says "cannot update. Database or object is read only"

If i change the export file to export.txt it works fine. The problem is I
need the file to be called export.dat for another routine to pick up. It
seems not to like the extension .dat

I'm running xp. Any ideas?
 
R

Rick Brandt

Jules said:
I have a problem in that if i use the following expression to export
data:

DoCmd.TransferText acExportDelim, "BKALLEXPT", "BACKLOADALL",
"\AT2000\ EXPORT.DAT"

I get an error which says "cannot update. Database or object is read
only"

If i change the export file to export.txt it works fine. The problem
is I need the file to be called export.dat for another routine to
pick up. It seems not to like the extension .dat

I'm running xp. Any ideas?

The newer versions after 97 do not support text import/export unless the
extension is "txt". Just rename the file after the transfer.
 
J

Jules Harris via AccessMonster.com

Thanks Rick,

....but how can i rename a file using VBA?

jules
 
R

Rick Brandt

Jules said:
Thanks Rick,

...but how can i rename a file using VBA?

jules

From Access 97 help file...

Name Statement

Renames a disk file, directory, or folder.

Syntax
Name oldpathname As newpathname

The Name statement syntax has these parts:

Part Description
oldpathname Required. String expression that specifies the existing file
name and location-may include directory or folder, and drive.
newpathname Required. String expression that specifies the new file name and
location-may include directory or folder, and drive. The file name specified
by newpathname can't already exist.
Remarks

Both newpathname and oldpathname must be on the same drive. If the path in
newpathname exists and is different from the path in oldpathname, the Name
statement moves the file to the new directory or folder and renames the
file, if necessary. If newpathname and oldpathname have different paths and
the same file name, Name moves the file to the new location and leaves the
file name unchanged. Using Name, you can move a file from one directory or
folder to another, but you can't move a directory or folder.

Using Name on an open file produces an error. You must close an open file
before renaming it. Name arguments cannot include multiple-character (*) and
single-character (?) wildcards.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top