Global $DBName = @ScriptDir & "\MDB.mdb"
Case $hWndListView2
Switch $iCode
Case $NM_CLICK
_GUICtrlListView_DeleteAllItems($hWndListView3)
$IndexItemListView2 = _GUICtrlListView_GetNextItem($hListView2) ; -> Numéro de ligne de la colonne
$tblname = "MesurePoints" ; -> Nom de la Table
$query = "SELECT * FROM " & $tblname & " WHERE Generation = " & "'" & _GUICtrlListView_GetItemText($hListView, $IndexItemListView) & "' And Station = '" & _GUICtrlListView_GetItemText($hListView2, $IndexItemListView2) & "'"
ConsoleWrite($query & @CRLF)
$adoCon = ObjCreate("ADODB.Connection")
$adoCon.Open("Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & $dbname) ;Use this line if using MS Access 2003 and lower
;$adoCon.Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & $dbname) ;Use this line if using MS Access 2007 and using the .accdb file extension
$adoRs = ObjCreate("ADODB.Recordset")
$adoRs.Open($query, $adoCon)
Do
_GUICtrlListView_AddItem($hListView3, $adoRs.Fields("Mesure").value, 0)
$adoRs.MoveNext
Until $adoRs.EOF
$adoCon.Close
EndSwitch
U:\Developpement\_AutoIt\_AutoItBestApp\Essai1\MyApp.au3 (155) : ==> The requested action with this object has failed.:
$adoRs.Open($query, $adoCon)
$adoRs.Open($query, $adoCon)^ ERROR
Si quelqu'un a une idée? J'ai pourtant l'habitude avec Excel mais AutoIt...
Merci par avance.
Modifié en dernier par Hugues le lun. 25 nov. 2013 08:50, modifié 1 fois.