Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2006
    Posts
    157

    Unanswered: 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

    _____

  2. #2
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •