Link to home
Start Free TrialLog in
Avatar of billkrieger
billkrieger

asked on

Delete records from a delimeted file being used as datasource for a linked server using Jet 4.0 OLE DB in ASP.net application

I have a .txt file that I am using as a datasource for a linked server. This is a log file that has 3 fields (date, path and message) that I am viewing in a gridview in asp.net.

Since this log file will grow, I would like to give users the ability to delete records in the file that have a date less then a date they choose in a parameter field.
Here is a sample of my SELECT statement:
Select convert(varchar(10),edate,101) as [Date], ePATH, eMessage from ARLOCKBOX...boaLog#txt
      WHERE convert(varchar(10),edate,101) = '11/10/2008'

I don't think Jet 4.0 supports deleting records through a query.

What is the best way to approach this?

Thanks in advance!
Avatar of Mark Wills
Mark Wills
Flag of Australia image

why not import the log file into a table, index according to the most commonly used access paths (but the looks it would include date), and then you can archive, delete, and make use of an indexed query.
Avatar of billkrieger
billkrieger

ASKER

Thanks for the response. The file will be appended to every night & it will grow very fast. so I was looking for a way to delete old records from the file. So I would not have to go through all the records in my queries. I gave them an option to export the web page results to an Excel file and delete the log file. The application will recreate it.

I did not find any way to be able to delete records in the file? Any suggestions?

Thanks again for taking the time.
ASKER CERTIFIED SOLUTION
Avatar of Mark Wills
Mark Wills
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial