Hello, everyone,

I'm trying to update a comma delimited text file using ADO. I am able to connect to it and do everything I need to it except update one of the fields.
The same code works in every thing else I use it to update except text files.
The error I'm getting is:

err.Number
-2147467259

err.Description
Updating data in a linked table is not supported by this ISAM.

Here is my code:

VB Code:
  1. Option Explicit
  2.  
  3. Sub Main()
  4.  
  5. Dim X As Long
  6.  
  7. Dim cn As New ADODB.Connection
  8. Dim rs As New ADODB.Recordset
  9.  
  10. Dim strPath As String
  11. Dim strSQL As String
  12.  
  13.     strSQL = "SELECT * FROM temp2.txt"
  14.     strPath = "G:\share\credit\Credit MIS\MIS Secure\"
  15.    
  16. DoCmd.Hourglass True
  17. cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=G:\share\credit\Credit MIS\MIS Secure\;Extended Properties=""text;HDR=Yes;FMT=Delimited"""
  18. rs.Open strSQL, cn, adOpenKeyset, adLockOptimistic
  19. DoCmd.Hourglass False
  20.  
  21. Do Until rs.EOF
  22. X = X + 1
  23.     If Format(rs!CallDT, "hh:mm:ss") >= "00:00:00" And Format(rs!CallDT, "hh:mm:ss") < "04:00:00" Then
  24.     rs!CallDT = Format(rs!CallDT, "Short Date") - 1
  25.     rs.Update
  26.         Else
  27.         rs!CallDT = Format(rs!CallDT, "Short Date")
  28.         rs.Update
  29.     End If
  30. rs.MoveNext
  31. Loop
  32.    
  33. rs.Close
  34. cn.Close
  35.  
  36. Set rs = Nothing
  37. Set cn = Nothing
  38.  
  39. End Sub

So you know, I've also tried opening the recordset using these three methods:

VB Code:
  1. rs.Open strSQL, cn, adOpenDynamic, adLockOptimistic
  2. rs.Open strSQL, cn, adOpenKeyset, adLockOptimistic
  3. rs.Open strSQL, cn, adOpenDynamic, adLockOptimistic

What am I doing wrong?

Thanks in advance!

Strick