I am trying to get all the values from a query, but everytime I do it only returns the first result.
When I run this query:
SELECT distinct order_id FROM ORDER_HEADERS where date_ordered = date()
It gives me 4 results in Access.
When I run it through Autoit's ADODB.RecordSet, it only gives me 1 record. How do I iterate through and get them all?
This is what I have so far!
Thanks in advance.
Local $orderID[2]
$queryOrder = "SELECT distinct order_id FROM ORDERS where date_created = date()"
$dbnameOrder = "myDB.mdb"
$adoConOrder = ObjCreate("ADODB.Connection")
$adoConRS = ObjCreate("ADODB.RecordSet")
$adoConOrder.Open("Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & $dbnameOrder)
$adoConRS.Open($queryOrder, $adoConOrder)
$recordcount = 0
;$orderID = $adoConOrder.Execute($queryOrder)
For $Field in $adoConRS.Fields
$recordcount +=1
ConsoleWrite($adoConRS.Fields("ORDER_ID").Value)
Next
MsgBox(0,"",$recordcount) ;This is just to see how many records it sees (only 1)