Output to a text file

G

Guest

Hi all (again)

Once again i find myself having to dip into the pot of wisdom...............

I have a multi user access databse. it's stored on a network server and
people access it by a mapped network drive.

I have a specific need to output the results of a query as a tab delimted
text file. So, I defined a spec, in this case called "samfileout" and added
this code to an on click event

DoCmd.TransferText acExportDelim, "samfileout", "q_SamUpload",
"samupload.txt", False

When I exported this from my dev copy to the working one on the network it
doesn't work. Users get a runtime error that the filespec "samfileout" does
not exisit. Where do i find this filespec and how do I export it to other
users?

I've searched the helpfiles and knowledge base but what help there is is on
Import not export, and does not seem applicable in this case.

Alternatively, is there a better way to this, where everything is contained
inside the database.
 
K

Ken Snell \(MVP\)

The second argument of the TransferText method is the name of an export
specification that you created and stored in the ACCESS database. This is
done manually by beginning the export process (File | Export), going through
all the screens to set the field specs, field names, etc., then on the last
screen of the wizard click the Advanced button at bottom left of the screen.
There you can save the specifications as an export specification. Then use
the name under which you store them as the export specification argument in
your code.
 
G

Guest

Yes, that much I do know, that's how I created the original spec in my dev
copy of the database.

I solved the problem by getting everyone out of the working copy and
redefining the spec there, but is there not a way I could have exported the
spec from my dev copy to the working copy of the database.

Or indeed, is there a better way for me to export a tab delimited text file
than the above.
 
K

Ken Snell \(MVP\)

You can import the import and export specifications from another database
this way:

In the database that is to "get" the specifications, go to File | Get
External Data ... | Import. Select the database that contains the
specifications. In the wizard screen, click the Options button at bottom
right; you'll see a checkbox that is next to "import/export specifications".
Check the checkbox, and then do the import.
 
J

jacksonmacd

Sounds like you have not split your database into frontend and backend
components. You should consider doing so, and supplying each user with
their own copy of the database.

http://www.granite.ab.ca/access/splitapp/index.htm

Once that's done, you will need a method for updating their frontend:
http://www.granite.ab.ca/access/autofe.htm

IIRC, your import and export specs will be included with your new
frontend.

Yes, that much I do know, that's how I created the original spec in my dev
copy of the database.

I solved the problem by getting everyone out of the working copy and
redefining the spec there, but is there not a way I could have exported the
spec from my dev copy to the working copy of the database.

Or indeed, is there a better way for me to export a tab delimited text file
than the above.

**********************
(e-mail address removed)
remove uppercase letters for true email
http://www.geocities.com/jacksonmacd/ for info on MS Access security
 

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

Top