Link to home
Create AccountLog in
Avatar of thomsone
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.connection")
set oRecordSet = createobject("adodb.recordset")
oConnection.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & sCSVFileLocation & ";Extended Properties=""text;HDR=yes;FMT=Delimited"""
oRecordSet.open "SELECT * FROM " & sCSVFile ,oConnection

How can I make this work in 2008 R2?  Thanks.
Avatar of RobSampson
RobSampson
Flag of Australia image

Avatar of thomsone
thomsone

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
Avatar of RobSampson
RobSampson
Flag of Australia image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Thanks for the grade.  If you need assistance rewriting your code, let me know.

Rob.