Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 25th, 2006, 01:05 AM
Registered User
 
Join Date: Feb 2006
Location: Sydney, NSW, Australia.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Outputto exceeded limit of rows

I have used the docmd.outputto command to export a query into Excel and have got the error message which states that the limit of Access or the OutputTo command has been exceeded. Does anyone know what the limit is and how to overcome it. There are 21095 rows to be exported. Here is a sample of the code:

Set qdfNew = CurrentDb.CreateQueryDef("NewQueryDef", _
                "SELECT * FROM [Adviser Flows - Holdings] WHERE [DbaseMngr] like '" & strFundMngr & "*'" _
                & "union all SELECT * FROM [ADVISER FLOWS - HOLDINGS Essentials Funds] WHERE [DbaseMngr] like '" & strFundMngr & "*'")
          'If there are records for the Fund Manager the data is exported into the Excel file
          If DCount("[DbaseMngr]", "NewQueryDef") <> 0 Then
                        StatusBar "The " & strFileNme & " is being created...."
            DoCmd.OutputTo acOutputQuery, "NewQueryDef", acFormatXLS, strPth & strFileNme


I would really appreciate any help you can give me.

Thanks
Renee
Reply With Quote
  #2 (permalink)  
Old February 26th, 2006, 12:14 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , USA.
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts
Default

Hi Renee,

Have you tried TransferSpreadsheet yet? I don't know what the limit of either function is (probably buried in some ancient document archive on MSDN). The two other options would be Excel Automation or the ADO connection string extended property "Extended Properties=""Excel 8.0""", both of which are touched on a bit on the other topic you posted to. Here's a TransferSpreadsheet routine:


Sub ExportSQL(strSQL As String)

    Dim db As DAO.Database
    Dim qdf As DAO.QueryDef

    On Error GoTo ExportSQL_Err

    Set db = CurrentDb
    Set qdf = db.CreateQueryDef("qryTemp", strSQL)
    qdf.Close

    DoCmd.TransferSpreadsheet acExport, , "qryTemp", "C:\Test.xls", True

ExportSQL_Exit:
    On Error Resume Next
    DoCmd.DeleteObject acQuery, "qryTemp"
    qdf.Close
    Set qdf = Nothing
    db.QueryDefs.Refresh
    Set db = Nothing
    Exit Sub
ExportSQL_Err:
    Resume ExportSQL_Exit
End Sub

Bob

Reply With Quote
  #3 (permalink)  
Old February 26th, 2006, 04:47 PM
Registered User
 
Join Date: Feb 2006
Location: Sydney, NSW, Australia.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Dear Bob

Thanks for your reply. I will give it a try and let you know how I go. I think I will find the same problem with transferspreadsheet and probably ADO is the way to go. I just have not had much experience with ADO.

Thanks so much once again.

Regards
Renee



Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
OutputTo .csv nspeelman Access 7 November 17th, 2008 01:37 PM
docmd.outputto Scripts82 Access VBA 0 March 9th, 2006 04:19 AM
outputto command ajmil11 Access 1 February 1st, 2006 08:21 AM
Limit rows returned and next rows minhpx General .NET 1 August 12th, 2004 06:25 AM
limit rows returned in a list box stoneman Access 1 January 16th, 2004 10:46 PM



All times are GMT -4. The time now is 01:53 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.