If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Save email data from text file into table

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-03-06, 14:21
mustish1 mustish1 is offline
Registered User
 
Join Date: Jul 2006
Posts: 149
Save email data from text file into table

I try to read a text file and insert into table. But first step it not print any thing nor any error.

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

_____
Reply With Quote
  #2 (permalink)  
Old 08-08-06, 17:11
wayneph wayneph is offline
Registered User
 
Join Date: Aug 2005
Location: D/FW, Texas, USA
Posts: 78
Try turning on Option Explicit.

In one place you're using sForm, and the other sFrom. Those are two different variables.
__________________
--wayne
SELECT * FROM Users WHERE Clue>0
0 rows returned
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On