tags:

views:

26

answers:

2

I've opened a dao recordset at a VB application. The problem is that I received an '3037' runtime error, this error says that I can't open any more tables or queries. So, I have to close some, but this doesn't seem to work... Is there any way to increase the number of opened recordsets?

I use the next code to sort a FlexGrid table when I clic on a column,

...
recordSet.Sort = recordSet.Fields(2).Name & " ASC"
Set Auxrecordset = recordSet.OpenRecordset
recordSet.Close
Set recordSet = Auxrecordset
...

Thanks.

EDIT:
Does this bug affects this? http://support.microsoft.com/kb/240401

A: 

Have you seen this kb article

http://support.microsoft.com/kb/165272

Looks like there might be a hotfix that's applicable, but you may already have it. Alternately, is it possible you're opening recordsets but not closing them somehow without realizing it (maybe because an error is being thrown and you're not reaching the close statement?)

drventure
Thanks for the answer, but i've opened the recordset and closed it in the same scope.
Joaquín M
A: 

instead of re-sending the query just to sort the data, why don't you do something like this: http://www.vb-helper.com/howto_sort_flexgrid.html to sort the data on the screen in the grid instead?

Goner Doug
Looks like a possible workaround. Thanks. I solved this bugs a few days ago, when I set the open and close in different scopes.
Joaquín M