OdbcDataAdapter Fill operation causing program to crash

SaintJimmy

Member
Joined
Jul 7, 2006
Messages
24
Programming Experience
5-10
I've got a program that's using an OdbcDataAdapter to connect to a MAS 90 database. I use the Fill method to populate my local DataSet, which has global scope. This is done when the program loads, and works fine during loading. The problem comes in when I try to refresh the data. I get a very cryptic error message that says my program has encountered an unexpected error and needs to close. And of course I have the option to send the stack trace to Microsoft or not.

I'm thinking this sounds like a problem with the ODBC driver, and not necessarily my application. I'm pulling other tables from an SQL Server database and all refresh operations I do on those execute fine.

Any thoughts? Comments?
 
But a try catch aorund the refresh operation.... make sure you Catch ODBCException and write the exception to a file, or at least to somekind of a text box that you can then see what's going on....

-tg
 
Already did

The call actually is in a Try... End Try block catching OdbcExceptions. But the operation is causing something similar to a GPF (remember those??), and the Catch block never gets a chance to execute. That's why I'm thinking it's a driver problem. It would have to be something external to the application.

I actually have problems with that driver when trying to import tables into SQL Server too, so I'm pretty sure that's it. Unfortunately, the company that engineered the driver no longer supports it.
 
I believe the appropriate term here is "Ooooh, schnap!"

Well, the way I see it, you have two alternatives: 1) check the data, see if there is something that exceeds the limits of the driver, and 2) Find a new driver, one that is still supported.

Both options suck like a Hoover....but that's all I've got.

-tg
 
Back
Top