Solved

Error repopulating MSHFlexGrid

Posted on 2002-07-30
7
473 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Vb.net 2008 2 56
add text to end of existing text in file 16 69
VB6 Compile Compatibility Issue 4 90
Protecting vb6 & .Net code Obfuscation 18 99
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…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

863 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

25 Experts available now in Live!

Get 1:1 Help Now