Solved

Error repopulating MSHFlexGrid

Posted on 2002-07-30
7
477 Views
Last Modified: 2008-02-20
I have a form to allow users to select historical data from a table by any of several criteria using combo boxes. The grid loads fine at Form load, but when the selections are made, and I try to load it again with the recordset from the selection statement, I get the following error:

Run-time error '30023':
Unable to access data. DataSource settings may be incorrect, or the DataSource functionality may be limited.

I have tried declaring this recordset locally, and in the General section.  I am clearing the grid, before opening the recordset and before setting the DataSource value to the recordset.  I have verified that, when I reach the statement assigning the DataSource for the grid, that my sql SELECT statement is correct, that my recordset is open, and has the selected data.  

0
Comment
Question by:isrspgmr
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 1

Expert Comment

by:knuckle05
ID: 7188824
Have you tried putting a data control on your form and connecting your grid to the data control? Then you could try refreshing the data control.

I'm not even sure if this is possible. Just an idea...
0
 

Author Comment

by:isrspgmr
ID: 7188855
Thank you for the suggestion.  Actually though, we have a company policy against using data controls. We try to stick to ADO objects.
0
 
LVL 1

Expert Comment

by:knuckle05
ID: 7188898
From what I've seen by looking around, it seems a lot of people have had this problem.

Try setting

MSHFlexGrid1.DataSource = Nothing

before you reset it.
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

Author Comment

by:isrspgmr
ID: 7189045
Yes, thanks again, but I had actually seen that suggestion in previously asked questions before I posted this one.  I have tried that, before setting the datasource, I've tried it earlier on, before opening the recordset.  No difference.  In debugging the code though, even without trying to assign Nothing as the datasource, I can see that that is the value of the datasource property right before I execute the datasource assignment line that causes the error.
0
 
LVL 2

Accepted Solution

by:
mmcmillen earned 100 total points
ID: 7190487
I have seen a situation where checking the recordset for eof prior to the set grd.datasource = recordset caused problems.  

I did try this at home last night on my system and I had no problem. Here at work, I have the same problem.


0
 

Author Comment

by:isrspgmr
ID: 7190567
Excellent.  I was in fact testing for .EOF before the datasource assignment.  I have now tried closing the recordset after the .EOF test, and then reopening the recordset, and that has eliminated the error.  Thanks for the help.
0
 

Expert Comment

by:gotorx7
ID: 7359130
This fix worked for me also.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question