Solved

Error repopulating MSHFlexGrid

Posted on 2002-07-30
7
472 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
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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
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 process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

744 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now