Falls jemand Interesse daran hat, dass ich ein Tutorial für ADO-Zugriffe auf SQL-Datenbanken (MS SQL, Oracle, MySQL, SQLite ..), Excel, Text-Dateien etc. erstelle, dann bitte hier voten.
Beispielcode. Das Tutorial erklärt dann, was hier genau geschieht.
[autoit]$sPath_to_database = "C:\Temp\text delimited files"
$connection = "DRIVER={Microsoft Text Driver (*.txt; *.csv)};Dbq=" & $sPath_to_database & ";Extensions=asc,csv,tab,txt;"
$adoCon = ObjCreate("ADODB.Connection")
$adoCon.Open($connection)
If @error Then Exit MsgBox(48, "Error", "error " & @error)
$adoRs = ObjCreate("ADODB.Recordset")
$adoSQL = "SELECT * FROM Countries.csv"
$adoRs.CursorType = 2
$adoRs.LockType = 3
$adoRs.Open($adoSQL, $adoCon)
With $adoRs
If .RecordCount Then
While Not .EOF
$sResult = $sResult & "" & .Fields("Continent").Value & "|" & .Fields("alpha_2").Value & "|" & .Fields("English_Country_Name").Value & @CR
.MoveNext
WEnd
EndIf
EndWith
$adoCon.Close
MsgBox(0, "Result", $sResult)