Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MSHFlexGrid Recordset Usage

Status
Not open for further replies.

pgk

Programmer
Jul 19, 2002
262
0
0
US
Hi

I am having a RecordSet, RsSql, that I assign to the Reocrdset property of a MSHFlexGrid. Once this is done, I clsoe the recordset. When I try to query for another set of criteria, I first try to initialize the grid as below:
Code:
GridApp.Rows = 0
GridApp.Cols = 0
GridApp.Rows = 2
GridApp.Cols = UBound(Arr_Grd_App) + 1
Arr_Grd_App contains info about the cell alignment, title of the column and so on.

When I try to initialize during requery, I got an error similar to the one below:
The object is disconnected from the client.

This error occured at GridApp.Rows = 0. This occurs sporadically.

I thought this might be due to the fact we are closing the recordset after assigning it to the grid and I tried to use a clone of the recordset for the assignment and it worked properly. But the doubt that came up was, what happens to all those cloned recordsets? Will they be lying in memory somewhere or will they be destoyed when I reassign a new cloned recordset to the RecordSet property of the grid?

Any suggestions would be most appreciated and sorry about the long post.

Thanks a lot.
 
I'm gathering that the underlying reason you're putting yourself to this trouble is that you don't want to leave the connection to the back end db open any longer than you have to. Given that this is the case, you may wish to investigate disconnected recordsets, for they are the standard means of accomplishing this.

Disconnected recordsets get their data and then disconnect from the source. You can then connect again when needed for requerying.

HTH

Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top