Question:
Can I retrieve data from a text file instead of querying an Access database?
Answer:
Yes, you can access a text file from an ASP page. Use the FileSystemObject COM component that ships with IIS.
First, create a FileSystemObject object.
Dim fs, f, strOneLine Set fs = CreateObject("Scripting.FileSystemObject")
Next, create a TextStream Object out of the FileSysemObject.
Set f = fs.OpenTextFile("c: estfile.txt", 1,0) ' -- in above code, ' -- 1 = for reading ' -- 0 = TriStateFalse
Read lines from the TextStream Object. Use the AtEndOfStream property to make sure you are not at end of file.
Do While f.AtEndOfStream <> True strOneLine = F.ReadLine ' -- do something with your line Loop
Finally, close all your objects.
F.Close Set f = Nothing Set fs = Nothing