Clearing out a linked text table


Question

I've got a linked table that's just a text file. How do I go about clearing it out from Access as I get an error 3617 saying the Delete operation's not supported (using Delete * from table...). I don't want to selectively delete anything, and I have exclusive use of the table in the application - I just need to empty it totally.

Answer

From: Shamil Salakhetdinov <shamil@marta.darts.spb.ru>
Subject: Re: Clearing out a linked text table
Date: 26 February 1999 11:38

Willie,

You can clear out linked text table (file) this way:

Public Sub AttTxtFileDel(ByVal vstrPath As String)
  Dim intFn As Integer
  intFn = FreeFile
  Open vstrPath For Output Access Write As #intFn
  Close #intFn
End Sub

HTH,
Shamil


HOME    TOPICS

Copyright © 1999 by Shamil Salakhetdinov.
All rights reserved. Terms of use.

Last updated: October 10, 2006

Published also here at 4TOPS: Clearing out a linked text table