Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

RecordSet in autoit using .mbd database

$
0
0

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)
 


Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>