none
Upgraded to Access 2007 RecordSet.EOF is broken? RRS feed

  • Question

  • This code is never hitting my loop condition in Access 2007, It works perfectly in Access 2003.

            

    Dim aRecordSet As New ADODB.Recordset 
        Dim aConnection As ADODB.Connection 
        Dim aSQLCmd As String
        aSQLCmd = "SELECT * FROM tblProducts WHERE " & _
                  "CustomerId= " & Quote(theCustomerId) & ";"
        Set aConnection = CurrentProject.Connection 'Uncommented -JR
        aRecordSet.Open aSQLCmd, aConnection, adOpenForwardOnly, adLockPessimistic, -1 

        Dim aDatabase As Database
        Set aDatabase = CurrentDb
        'Dim aRecordSet As Recordset 'Changed back to Recordset from DAO.Recordset
        SetEnv "CustomerId", theCustomerId
        Set aRecordSet = aDatabase.OpenRecordSet("qrySalesRptProduct", dbOpenForwardOnly)

        Do While (Not aRecordSet.EOF)

    {........}

    Do I need to update my References?

    Wednesday, March 25, 2015 7:55 PM

All replies