I have followed the threads on this forum for some time with great success. Now I am trying to open up a recordset from a precreated table, delete all records in that table, and read in the new ones. Here is the important part of the code: The problem is trying to DELETE the rows without deleting the entire table...
Set DB = CurrentProject.Connection
Set rst = New ADODB.Recordset
rst.ActiveConnection = CurrentProject.Connection
rst.Open "SalesFiles", , adOpenKeyset, adLockOptimistic, adCmdTable
REM Now I need steps to delete rows in sales files
REM this part loads in the new data
Temp = Dir(Location, vbNormal)
Rem rst.Fields(1).Name = "FileNames"
While Temp <> ""
With rst
.AddNew
.Fields("FileNames"
= Temp
.Update
Temp = Dir
End With
Wend
Everything works but I can't find any code that works to delete data in rows of a ADODB connection.
Thanks
Set DB = CurrentProject.Connection
Set rst = New ADODB.Recordset
rst.ActiveConnection = CurrentProject.Connection
rst.Open "SalesFiles", , adOpenKeyset, adLockOptimistic, adCmdTable
REM Now I need steps to delete rows in sales files
REM this part loads in the new data
Temp = Dir(Location, vbNormal)
Rem rst.Fields(1).Name = "FileNames"
While Temp <> ""
With rst
.AddNew
.Fields("FileNames"
.Update
Temp = Dir
End With
Wend
Everything works but I can't find any code that works to delete data in rows of a ADODB connection.
Thanks