Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

operation must use an updatable query 2

Status
Not open for further replies.

ClydeData

Technical User
Feb 6, 2003
141
GB
I am building a database viewer for customer, Customers will have their own cut down version of the database with their a copy of the data emailed to them

I want to email the data daily as a multi tab xls spreadsheet, to do this I wish to

1. use FileCopy to get blank version of spreadsheet
2. Use append queries to add data to each of the tabs in spreadsheet

With the append queries I get the error message “operation must use an updatable query”

Access will not allow you to append data to an xls spreadsheet Linked table.


Is their anyway round this

Thanks


Jimmy
 
Duane
Thanks for that link
I'll check it out

One thing I think ill look at is sending an mdb file with all tables forms & queries as an email attachment.

I'm sure I can find the code somewhere on Tek Tips to zip an mdb ready for attachment to an outlook email

Thanks

Jimmy
 
You can use the Windows Shell to ZIP files
Code:
Private Sub cmdZipIt_Click()
    Dim ZipFile                     As String
    ZipFile = "c:\testzip\myMDB.zip"
    CreateEmptyZip ZipFile 

    With CreateObject("Shell.Application")

        ' Copy a file into the compressed folder.
        .NameSpace(ZipFile).CopyHere "c:\myFolder\myMDB.mdb"

    End With
    
End Sub

Public Sub CreateEmptyZip(sPath)
    Dim strZIPHeader                As String
    
    ' header required to convince Windows shell that this is really a zip file
    strZIPHeader = Chr$(80) & Chr$(75) & Chr$(5) & Chr$(6) & String(18, 0)
    
    With CreateObject("Scripting.FileSystemObject")
        .CreateTextFile(sPath).Write strZIPHeader
    End With

End Sub
 
Thanks Golom

That should work fine,

I can now attach the zipped mdb file to an outlook mail message in the usual way

Thanks

Jimmy



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top