Global $oObjError = ObjEvent("AutoIt.Error", "_ObjError")
$sDBHost = "" ; Адрес сервера
$sDBName = "" ; Название Базы Данных
$sDBUser = "" ; Пользователь
$sDBPass = "" ; Пароль
$sDBCSVPath = "C:\2.csv" ; Путь к CSV файлу
$sDBCSVPath = StringReplace($sDBCSVPath, "\", "\\")
Global $sDBConnStr, $oDBConn = ObjCreate("ADODB.Connection")
$sDBConnStr &= "DRIVER={MySQL ODBC 5.1 Driver};SERVER=" & $sDBHost & ";DATABASE=" & $sDBName & ";"
$sDBConnStr &= "UID=" & $sDBUser & ";PWD=" & $sDBPass
$oDBConn.Open($sDBConnStr)
If Not $oDBConn.State Then Exit 99 + 0 * MsgBox(0 + 48, $sAppLN, "Can't Connect To Database!")
$aQ = "LOAD DATA LOW_PRIORITY LOCAL INFILE '" & $sDBCSVPath & "' INTO TABLE `" & $sDBName & "`.`table` FIELDS TERMINATED BY ';' OPTIONALLY ENCLOSED BY '""' LINES TERMINATED BY '\r\n' IGNORE 1 LINES (`field1`, `field2`, `field3`);"
ConsoleWrite($aQ & @CR)
$oDBConn.Execute($aQ)
$oDBConn.Close
Func _ObjError()
ConsoleWrite("$oObjError.Description = " & $oObjError.Description & @CRLF)
ConsoleWrite("$oObjError.WinDescription = " & $oObjError.WinDescription & @CRLF)
ConsoleWrite("$oObjError.Number = " & Hex($oObjError.Number, 8) & @CRLF)
ConsoleWrite("$oObjError.LastDllError is = " & $oObjError.LastDllError & @CRLF)
ConsoleWrite("$oObjError.ScriptLine is = " & $oObjError.ScriptLine & @CRLF)
ConsoleWrite("$oObjError.Source is = " & $oObjError.Source & @CRLF)
ConsoleWrite("$oObjError.HelpFile is = " & $oObjError.HelpFile & @CRLF)
ConsoleWrite("$oObjError.HelpContext is = " & $oObjError.HelpContext & @CRLF)
Exit
EndFunc ;==>_ObjError