Results 1 to 7 of 7
  1. #1
    JeroenMioch's Avatar
    JeroenMioch is offline Competent Performer
    Windows Vista Access 2003
    Join Date
    May 2012
    Location
    Den Haag, Netherlands
    Posts
    368

    Query to .CSV problem

    Hey guys,

    I'm trying to export a query to a .csv file.
    This works fine when i use the wizard to do so but i want to automate it.


    But when i use code below the export is as .csv but it looks like a plain excel sheet. I need it to be with the comma delimiter.

    Im using the export specifications of the wizard (KrpExportspecificatie) as shown below but it looks like access doenst remember what to do.

    Code:
    DoCmd.TransferText acExportDelim, krpExportspecificatie, "qryCSV", "C:\Mylocation\Applications\FOL\KRP\" & Format(Date, "DD-MM-YYYY") & " KRP.csv", False
    Any clues or hint as to where im going wrong ?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    What parameters are provided by the export specification? Have you tried to export without referencing it?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    JeroenMioch's Avatar
    JeroenMioch is offline Competent Performer
    Windows Vista Access 2003
    Join Date
    May 2012
    Location
    Den Haag, Netherlands
    Posts
    368
    Yes i did, same effect.
    At first i got the feeling i was missing something redicilously simple. But ive looked at it for hours now changing simple things but im getting demotivated now haha.

    The export specification file should "remember" wich delimiters i chose, but its just not working.
    I tried doing a maketableQuery to see if it would work from a table in stead of a query, to no effect.


  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    I just tested export to csv text file and it did save with comma delimiters. I see them when I open the file with a text editor like Notepad. However, also has quote marks around each text value. Didn't expect that.

    If you want to provide your db for analysis, follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    JeroenMioch's Avatar
    JeroenMioch is offline Competent Performer
    Windows Vista Access 2003
    Join Date
    May 2012
    Location
    Den Haag, Netherlands
    Posts
    368
    Right it seems im a noob (at best)
    I should have put krpExportspecificatie in quotation marks like this "krpExportspecificatie"

    lol !

    Thanks anyway June

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Sorry I didn't notice that. Don't do many exports. Glad it's solved.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    JeroenMioch's Avatar
    JeroenMioch is offline Competent Performer
    Windows Vista Access 2003
    Join Date
    May 2012
    Location
    Den Haag, Netherlands
    Posts
    368
    Dont be sorry, i should have seen it.
    But its funny to see how asking for help opens the eyes, even if the one providing help didnt provide the answer.
    I have many non programming coworkers here and when im starting to talk to them about code, i find the answer i was looking for.

    Psychology.. pff

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

Similar Threads

  1. Query problem with c#
    By udigold1 in forum Queries
    Replies: 1
    Last Post: 12-19-2010, 08:34 PM
  2. query problem
    By phoebe in forum Queries
    Replies: 1
    Last Post: 08-23-2010, 02:00 PM
  3. Query Problem
    By rblundell in forum Queries
    Replies: 2
    Last Post: 11-26-2009, 08:29 PM
  4. query problem i have a problem wi
    By maxx3 in forum Queries
    Replies: 0
    Last Post: 06-29-2009, 02:29 AM
  5. problem with query
    By kiethb in forum Queries
    Replies: 3
    Last Post: 04-24-2009, 11:42 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