jdicerch 0 Posted July 8, 2013 Share Posted July 8, 2013 (edited) 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) Edited July 8, 2013 by jdicerch Link to post Share on other sites
Solution jdicerch 0 Posted July 8, 2013 Author Solution Share Posted July 8, 2013 Never Mind. I figured it out by adding a While Not $adoConRS.EOF before going through the fields Thanks anyway! Link to post Share on other sites
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now