I'm using Visual Basic 6.0 Enterprsise Edition
I have Two queries TankerExpQuery and TankerExpTotalQuery in Access 2000 database both queries both are built from the Invoice table and are joined with invdate
the fiels in TankerExpTotalQuery are Grouped By InvDate
The description of query is
sqlQuery = "SELECT TankerExpQuery.TankerNo, TankerExpQuery.BalDue, TankerExpQuery.InvNo, TankerExpQuery.InvDate, TankerExpQuery.StCity, TankerExpQuery.DestCity, TankerExpQuery.ProdName, TankerExpQuery.Quantity, TankerExpQuery.Amount, TankerExpQuery.ShtQty, TankerExpQuery.ShtAmt, TankerExpQuery.Exp, TankerExpQuery.Reason, TankerExpTotalQuery.SumOfAmount, TankerExpTotalQuery.SumOfCom, TankerExpTotalQuery.SumOfShtAmt, TankerExpTotalQuery.SumOfExp " & _
"FROM TankerExpTotalQuery INNER JOIN TankerExpQuery ON TankerExpTotalQuery.InvDate = TankerExpQuery.InvDate " & _
"WHERE (TankerExpQuery.TankerNo = '" & ComTankerNo.Text & "') AND (TankerExpQuery.InvDate Between #" & txtFrom.Text & "# And #" & txtTo.Text & "#) " & _
"ORDER BY TankerExpQuery.InvNo;"
rst.Open sqlQuery, cnn, adOpenKeyset, adLockPessimistic
When i used rst.Fields(0).Name
It gives me a field name but if i use
rst.MoveNext
it gives me a error message
Rum-time error '3021'
Either BOF or EOF is true, or the current record has been deleted;
the operation requested by the application requires a current record;
When i run this query in Access 2000 it works fine.
If I check MsgBox rst.EOF and MsgBox rst.BOF both messages shows me true
If someone has any idea about this error i would really appreciate it
thanks in advance.