Results 1 to 8 of 8
  1. #1
    Juan4412 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Dec 2010
    Posts
    209

    Export Query To SQL Server

    I have tried this syntax
    Code:
    DoCmd.TransferSpreadsheet acOutputQuery, acSpreadsheetTypeExcel12, "QueryName", "C:\Test\QueryExport.xlsx", True
    However, I get an error of
    Run-time error '3323':
    The query can not be used as a row source

    This is a simple select query, and I just want to write the result to Excel.

  2. #2
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    acOutputQuery should be acExport.

    Am wondering why your subject line mentions SQL Server?

  3. #3
    Juan4412 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Dec 2010
    Posts
    209
    Good catch - to much on my mind this morning.

    If I change it to acExport I get the same error.

  4. #4
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Do it manually from the nav pane to test (a) exporting the query and (b) writing to that folder. Then you will be able to narrow down the problem.

  5. #5
    Juan4412 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Dec 2010
    Posts
    209
    You are over my head on that one....
    How would I do this?

  6. #6
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Go to the nav pane, the place where it has the list of queries. Right-click on the query that you are trying to export, click export/Excel. Copy and paste or browse to that location you have specified.

  7. #7
    Juan4412 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Dec 2010
    Posts
    209
    Write permissions to the directory was the problem. Thank you for walking me through it

  8. #8
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    You're welcome!

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

Similar Threads

  1. Replies: 1
    Last Post: 08-11-2016, 08:25 AM
  2. export to a Server...instead of excel to dropbox!@
    By gangel in forum Import/Export Data
    Replies: 1
    Last Post: 03-29-2016, 08:50 AM
  3. Export Data from Access 2003 Table to SQL Server 2012 Table.
    By Robeen in forum Import/Export Data
    Replies: 3
    Last Post: 02-26-2016, 02:07 PM
  4. Export Access 2013 to sql server 2012
    By jassie in forum Import/Export Data
    Replies: 2
    Last Post: 05-18-2015, 01:03 PM
  5. Replies: 1
    Last Post: 09-13-2011, 01:52 PM

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