wen_dell Level: Scholar
 Registered: 17-01-2005 Posts: 44
|
I could not delete the file
i could not figure out why the DBF that i trying to delete raised an error of "Permission denied" even though i closed the recordset and connection for that DBF file and set their variables to nothing. Can anybody help me with this problem
Dim CnFox As New ADODB.Connection
Dim RsCur As New ADODB.Recordset
Dim iFile As New FileSystemObject
CnFox.Open "Provider=MSDASQL.1; Driver={Microsoft Visual Foxpro Driver}; SourceType=DBF; SourceDB=" & App.Path & "; Exclusive=No;"
RsCur.Open "SELECT * FROM CurrentItemMast ORDER BY StockNo", CnFox, adOpenForwardOnly, adLockReadOnly
'my codes
'
'
'
RsCur.Close
CnFox.Close
Set RsCur = Nothing
Set CnFox = Nothing
iFile.DeleteFile App.Path & "\CurrentItemmast.dbf", True
'or
'Kill App.Path & "\CurrentItemmast.dbf"
Set iFile = Nothing
[Edited by wen_dell on 25-07-2007 at 05:46 PM GMT]
____________________________
GOD IS MY SHEPERD
|