Runtime error - Automation error

Hei,

I am working with on application developed in VB6. Data are stored in an Access MDB file. Connection from application through ODBC.
Using a form with a TrueDBGrid grid control. Source for this grid is an ADODC control.

When changing SQL statement and doing a refresh to the dataset I approximately 1 out of 30 times receive an Automation error (-2147467259 Automation error Unspecified error) when doing a refresh to the ADODC control.

Code:
DataGeneesmiddelen.RecordSource = (gstrSQLSelectie)
DataGeneesmiddelen.Refresh ==> -2147467259 Automation error Unspecified error

Please some help!

Regards
Carl G
CarlGustavAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
There is little you can do other than trap for that error if possible and then throw it away. Personally I don't use the ADODC - can you not bind TrueDBGrid directly to a recordset?
0
CarlGustavAuthor Commented:
Thank you for your comment. We do catch the error and loop until control accept a refresh.
I will give recordset a try!

But do you have any idea why this happens?

Regards
Carl G

0
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Not really, and the error is (of course) less than helpful in regard to troubleshooting. Do you get the error when refreshing the dataset for the ADODC control, or for the TrueDBGrid? In most cases you have to (a) refresh ADODC and then (b) refresh the TrueDBGrid. When does the error occur?
0
Newly released Acronis True Image 2019

In announcing the release of the 15th Anniversary Edition of Acronis True Image 2019, the company revealed that its artificial intelligence-based anti-ransomware technology – stopped more than 200,000 ransomware attacks on 150,000 customers last year.

CarlGustavAuthor Commented:
The error occur when refreshing ADODC control - which automatically refreshes TrueDBGrid.
0
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
I would assume then that there is some issue during that communication between the ADODC and TrueDBGrid. As you have no control over it (i.e. you just "set" the TrueDBGrid to use your ADODC control) there is little you can do to stop it other than trap the error as you're doing now.

Most devs don't use the ADODC control precisely for reasons like this - you have no control over many things.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
CarlGustavAuthor Commented:
Verified a major problem.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Development

From novice to tech pro — start learning today.