我正在尝试执行一个非常简单的示例,该示例使用 SQLOLEBD 使用 VBScript 从 CSV 文件中检索记录。我收到错误:行:4 字符:1 错误:无效的连接字符串属性”代码:80004005 来源:Microsoft OLD DB Provider for SQL Server 有人可以帮我理顺吗?
Set objConnection = CreateObject("ADODB.Connection")
Set objRecordSet = CreateObject("ADODB.Recordset")
objConnection.Open "Provider=SQLOLEDB; Data Source= C:\Users\public\; Extended Properties=""text;HDR=YES;FMT=Delimited"""
objRecordset.Open "SELECT * FROM employees.csv, objConnection, adOpenStatic, adLockOptimistic, adCmdText"
Do Until objRecordset.EOF
Wscript.Echo "name: " & objRecordset.Fields.Item("Name")
objRecordset.MoveNext
Loop
wscript.echo "Finished"
员工.csv
id,name,grade 1,"Ezequiel, Justin",1 2,Charlie Sheen,4 3,"Name, Your",8 4,Another Guy,16