thomsone
asked on
Read CSV file in VBScript on Windows Server 2008 R2
I have a VB Script script that used to work on Windows Server 2003, but now it won't work in 2008. It uses Jet to read a CSV file. The lines that are failing are as follows:
set oConnection = createobject("adodb.connec tion")
set oRecordSet = createobject("adodb.record set")
oConnection.open "Provider=Microsoft.Jet.OL EDB.4.0;Da ta Source= " & sCSVFileLocation & ";Extended Properties=""text;HDR=yes; FMT=Delimi ted"""
oRecordSet.open "SELECT * FROM " & sCSVFile ,oConnection
How can I make this work in 2008 R2? Thanks.
set oConnection = createobject("adodb.connec
set oRecordSet = createobject("adodb.record
oConnection.open "Provider=Microsoft.Jet.OL
oRecordSet.open "SELECT * FROM " & sCSVFile ,oConnection
How can I make this work in 2008 R2? Thanks.
ASKER
Thanks, Rob, but I don't think that gives me what I need. I think I need an example of how you use a driver other than Jet to open a CSV file in vbScript so that this is able to run on Windows Server 2008 R2. If there's some alternative construct that can be used to cycle through the CSV file, then I think I'm good to go.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Thanks for the grade. If you need assistance rewriting your code, let me know.
Rob.
Rob.
https://www.experts-exchange.com/questions/27587886/Microsoft-Jet-OLEDB-4-0-in-a-Logon-Script.html?anchorAnswerId=37795001#a37795001
Regards,
Rob.