Result Set Issues

Below is my very simple code, the problem is it puts together the result set first and it was only gahering about 4200 out of about 17000. I added the Cachelimit, it now gathers them all but it won’t go to FirstRow in the reult set or set and delete the current row, it just ignores the command. When the Table has under 4300 Rows everything is fine

Set con = New ODBCConnection

Set qry = New ODBCQuery

Set result = New ODBCResultSet

Set qry.Connection = con

Set result.Query = qry

con.ConnectTo(“odbc2”)

qry.SQL = “SELECT * FROM FIRM”

result.cacheLimit = DB_ALL

result.Execute

Call DisplayResultSetProperties

result.FirstRow

result.LastRow

result.FirstRow

currentRow = Inputbox _

(“Which row do you want to delete?”, “Which row?”)

If currentRow = “” Then

Messagebox “No value entered for row”, “Bad row”

Exit Sub

End If

If currentRow < 1 Or currentRow > result.NumRows Then

Messagebox “Row out of range”, “Bad row”

Exit Sub

End If

result.CurrentRow = currentRow

result.DeleteRow(“FIRM”)

Call DisplayResultSetProperties

result.Close(DB_CLOSE)

con.Disconnect

errorHandler:

If con.GetError <> DBstsSuccess Then

Messagebox con.GetErrorMessage, _

WhatIsError(con.Error)

Elseif qry.GetError <> DBstsSuccess Then

Messagebox qry.GetErrorMessage, _

WhatIsError(qry.Error)

Elseif result.GetError <> DBstsSuccess Then

Messagebox result.GetErrorMessage, _

WhatIsError(result.Error)

End If

Exit Sub