Hi Rob,
"Rob Booth via SQLMonster.com" wrote:
Quote:
Thanks for the information. The character sets in the files should
both be standard ASCII. Do you have any thoughts on how I'd check
the format of the file in ActiveX? |
here is a small code sample that hopefully explain how to check it
---------------------------
intCrLf = 0
intLf = 0
Set fso = CreateObject("Scripting.FileSystemObject")
Set oFileIn = fso.OpenTextFile(fileIn)
'Here we read 1000 characters as long as we find CrLf or Lf
Do While ((Not oFileIn.atEndOfStream) AND intCrLf = 0 AND intLf = 0)
Text = oFileIn.Read(1000)
intCrLf = Instr(1,Text,vbCrLf)
intLf = Instr(1,Text,vbLf)
Loop
' now we can decide which filetype we have
If (intCrLf > 0) Then 'DOS
....
Else If (intLf > 0) Then 'Unix
....
-------------------
You should check for file existence first and handle errors right.
See http://www.sqldts.com/default.aspx?292 for examples for file handling
Helge