Re: How come this Script Doesn't work?
From: Joe McMillan (MoeJoe_at_hcnews.com)
Date: 03/04/05
- Next message: Torgeir Bakken \(MVP\): "Re: Script to get Computer Memory Config"
- Previous message: Joe McMillan: "Re: Determine date for a given week of the year"
- In reply to: Jim Bayers: "Re: How come this Script Doesn't work?"
- Next in thread: Jim Bayers: "Re: How come this Script Doesn't work?"
- Reply: Jim Bayers: "Re: How come this Script Doesn't work?"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 4 Mar 2005 12:04:46 -0600
OKAY! I discovered that, using no path on the outfile, my computer wrote
the file to c:\. Is that possible for you?
--
Joe Phillips, Support Technician
HCN Internet Services
"I am not an expert, just experienced."
"Jim Bayers" <spamity@spam.spam> wrote in message
news:Pine.WNT.4.61.0503041008110.2752@VirtualXP2.em.arizona.edu...
I'm not sure what else to add. If I hardcode the file paths into the
script, it works. If I drag and drop the file on the script, it doesn't
work. Just the filename is causing the problem. The script works
otherwise.
If I drag and drop the delimited text file onto the script, it will read
the delimited text file, however, it won't write to the new file.
ø¤°`°¤ø,¸_¸,ø¤°`°¤ø,¸_¸,ø
On Fri, 4 Mar 2005, Jim Bayers wrote:
>
> I wanted to set this up so that when I drag and drop a
> delimited text file onto it, it would create a sql
> script. It works if I hardcode the filename but if I
> drag and drop, it fails.
>
> ''''''''''''''''''''''''''''''''''
> ' script to create sql updates from
> ' delimited files
> '
>
> Const ForReading = 1
>
> main
>
> sub main()
> Dim fso, fin, fout, line, objArgs, infile, ary, str
> Set objArgs = WScript.Arguments
> Set fso = CreateObject("Scripting.FileSystemObject")
> Set fout = fso.CreateTextFile("updateout.sql", True)
> Set fin = fso.OpenTextFile(objArgs(0), ForReading)
> While Not fin.AtEndOfStream
> line = fin.ReadLine()
> ary = split(line, vbTAB)
> if ary(2) = "" then
> ary(2) = "NULL"
> else
> ary(2) = "'Y'"
> end if
> str = "UPDATE HOL_Students SET IsInternational='" & _
> ary(1) & "', Resident=" & ary(2) & ", AcademicIndex="
> & _
> ary(3) & " WHERE SID='" & ary(0) & "'"
> fout.WriteLine str
> Wend
> fin.Close
> fout.Close
> end sub
>
>
> ø¤°`°¤ø,¸_¸,ø¤°`°¤ø,¸_¸,ø
>
- Next message: Torgeir Bakken \(MVP\): "Re: Script to get Computer Memory Config"
- Previous message: Joe McMillan: "Re: Determine date for a given week of the year"
- In reply to: Jim Bayers: "Re: How come this Script Doesn't work?"
- Next in thread: Jim Bayers: "Re: How come this Script Doesn't work?"
- Reply: Jim Bayers: "Re: How come this Script Doesn't work?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|