Save email data from text file into table
am 04.08.2006 01:38:16 von EricI try to save a textfile into access table. But on first stage when i
try to read data it not showing any thing.
Dim fso, fil, ts, sContents
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set fil = fso.getfile(server.mappath("myemails.txt"))
Set ts = fil.openastextstream(1)
sContents = ts.readall
aBuild = Split(sContents, "From:", 2)
sFrom = Split(aBuild(1), vbCrLf, 2)(0)
response.write(sForm)
ts.close
Set ts = nothing
Set fil = nothing
Set fso = nothing
---------SAMPLE DATA-----------
From: Walker, Kyle x58278
Sent: Tuesday, August 01, 2006 10:36 AM
To: Coghiel, Courtney x57148; VanRiper, Brad;
Bridgers, Rod; Marques, Joe; Vargas, Julian
Cc: Johnson, Collette x57400; Khan, Eric; Feldman,
Marisa x58114; Gollab, Maxine x58114
Subject: RE: NEW USER ID WH-02
Eric,
Please add these into the DB. Thanks.
KW
_____
From: Coghiel, Courtney x57148
Sent: Tuesday, August 01, 2006 10:35 AM
To: Walker, Kyle x58278; VanRiper, Brad; Bridgers,
Rod; Marques, Joe; Vargas, Julian
Cc: Johnson, Collette x57400; Khan, Eric; Feldman,
Marisa x58114; Gollab, Maxine x58114
Subject: NEW USER ID WH-02
ANTHONY MANISCALCO 1720
DINO WILLIAMS 1718
From: Coghiel, Courtney x57148
Sent: Tuesday, August 01, 2006 10:35 AM
To: Walker, Kyle x58278; VanRiper, Brad; Bridgers,
Rod; Marques, Joe; Vargas, Julian
Cc: Johnson, Collette x57400; Khan, Eric; Feldman,
Marisa x58114; Gollab, Maxine x58114
Subject: NEW USER ID WH-02
ANTHONY MANISCALCO 1720
DINO WILLIAMS 1718
From: Walker, Kyle x58278
Sent: Tuesday, August 01, 2006 9:02 AM
To: Khan, Eric
Subject: RE: Monthly Hours
Attachments: WROTRFY2007.xls
Two tabs, one for supplementing and one for Putaway.
Thanks Eric.
KW