[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference bump::msaccess

Title:MSACCESS
Moderator:BUMP::HONER
Created:Tue Dec 01 1992
Last Modified:Mon Jun 02 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:1661
Total number of notes:6339

1649.0. "IDC and export to Excel" by ENGPTR::MCMAHON () Mon Apr 07 1997 11:13

    I'm using IIS and IDC to have my web-based query interface run reports
    against a SQL SERVER database. This works fine but what my users want
    is to take the results of the query and export them to an Excel
    spreadsheet. The reason I'm posting this here is that the database is
    delivered to me in Access so I was thinking of writing a module that
    would accept a table name, an SQL query string and a (Excel) filename
    and have Access do the output to Excel.
    
    I don't know Access very well but I did create a macro that does what I
    want but of course it doesn't accept arguments.
    
    I thought I'd create a module with a Sub procedure like this:
    
    Public Sub CreateSpreadsheet (tablein, sqlexp, xlfileout)
      DoCmd OpenTable 'tablein'
      DoCmd ApplyFilter 'sqlexp'
      DoCmd OutputTo 'xlfileout'
    End Sub
    
    Now, presuming that this works, how can I call this using IDC to pass
    in the parameters?
    
    Also, do you think this procedure will work as written?
    
    And finally, if anyone has a better idea on how to do what I need, I'm
    all ears! ;-)
    
    Thank you.
T.RTitleUserPersonal
Name
DateLines
1649.1Access V7 on NT 4.0ENGPTR::MCMAHONMon Apr 07 1997 11:342
    p.s. This is an Access95 V7 database on an NT 4.0 machine, it it
    matters.