Results 1 to 2 of 2
  1. #1
    itm is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jun 2011
    Posts
    69

    trying to export data to a text file

    Hi,


    I am trying to run a simply text dlimited export in Access vba:
    My code:


    Code:
    1. Private Sub Command16_Click()
    2. DoCmd.TransferText acExportDelim, "LBTxt Export Specification", "temp", "C:\Test", True </SPAN>
    3. End Sub </SPAN>
    and when I run it I get the following:

    I get Run- time error '3027'
    cannot update. Database or object is read-only.
    I also get this on any table that I try. and I get it if I try maken a macro as well.
    Now I should point out that the text file does not exist, but this should create it right?
    if I manualy do an export I have no problem.
    Neither the database or the table is not set to read only so I do not know.
    Actually I cannot tell about the table but I did not set anything.
    Any help aould really be appricated
    Thank you

  2. #2
    itm is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Jun 2011
    Posts
    69
    Hi Solved this by using this method:
    DoCmd.TransferText transfertype:=acExportDelim, _
    specificationname:="Test707", _
    tablename:="Temp", _
    filename:= "C:\Test", _
    hasfieldnames:=True

    Thank you

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 06-09-2011, 11:10 PM
  2. Export to Text File Using DoCmd Access 2007
    By tonere in forum Programming
    Replies: 1
    Last Post: 03-30-2011, 06:14 PM
  3. Export data to .doc(x) file
    By fat drummer in forum Import/Export Data
    Replies: 0
    Last Post: 07-28-2010, 03:51 PM
  4. Data from text file
    By Directlinq in forum Programming
    Replies: 1
    Last Post: 10-19-2009, 02:29 AM
  5. Export data as text for layout
    By Debby in forum Import/Export Data
    Replies: 3
    Last Post: 04-26-2009, 05:10 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums