Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2012
    Posts
    108
    Provided Answers: 1

    Unanswered: Delete All Records From A Table In Another Database

    Hi all,

    Using Access 2007.
    I would like to delete all records from a table in another database before I append new records to it.

    My SQL string is giving a Type Mismatch error
    Any idea what might be wrong?

    Code:
         strSQL = ""
         strSQL = strSQL & "DELETE .* " & _
         strSQL = strSQL & "FROM SFDC_New " & _
         strSQL = strSQL & "IN ""C:\Data\Foo.accdb""; "
         db.Execute strSQL, dbFailOnError
    thx
    w

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Try:
    Code:
         Dim strSQL As String
         strSQL = "DELETE FROM SFDC_New IN 'C:\Data\Foo.accdb';"
         CurrentDb.Execute strSQL, dbFailOnError
    Have a nice day!

  3. #3
    Join Date
    Feb 2012
    Posts
    108
    Provided Answers: 1
    Thanks Sinndho,

    That works great!

    thx
    w

  4. #4
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    You're welcome!
    Have a nice day!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •