Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CRecordset, MS Access, Paradox, ...nasty bug. ...please help.

Status
Not open for further replies.

shatleyb

Programmer
Nov 5, 2002
3
0
0
US
Hello,

I'm using MS Access 2000 to link to a couple of Paradox 3.0 tables. My MFC application uses a couple of derived CRecordset classes to interact with the Access database via ODBC. One, of which, is based on a query that is based on two of the linked Paradox tables.

Here's the problem. The app works fine when the Paradox .db files are on the local machine. The app works fine on my network when the .db files are on another machine. However, when I run the application at my Customer's office, where the .db files reside on an NT server, the CRecordset object connected to the query based on the linked tables returns no records. However, when the same exact same query is executed in the Access environment, it returns records. My customer recently moved the Paradox database to their server. My app ran fine on their local machine as well. When I pointed the linked tables to the new location of the .db files, the app stopped working.

Does anyone have any suggestions? I am at a complete loss. I have no idea where to even start looking. I have ran a few tests over my network involving query timeout settings, and that doesn't seem to be the problem. Any suggestions would be greatly appreciated.
 
I think connection string/driver has changed...Make sure that connection string is fine and database(back end) is working fine first..
 
Pankajkumar may be right. Your connect string may be wrong now. After all, you're hitting a different database on a different system. Another possibility is that the customer doesn't have the right ODBC drivers set up.

I assume you are also using a CDatabase object to make the connection to the database. Check to see whether it's really opening.

Are you doing exception handling when you open your CDatabase object and CRecordset object. If something goes wrong, they throw an exception. If you try to open your recordset and it throws and exception indicating it has no database connection, then you know where your problem lies.

If you aren't catching exceptions, you ought to be. You should NEVER have a program that uses a database without exception handling, because so many things can go wrong. If you aren't doing it and you don't know how, let me know, and I'll show you.
 
I am using CDatabase. However, I'm still hitting the same Access db, on the same machine, using the same ODBC driver. The Paradox tables are linked through Access (as MSDN recommends). My app uses the default CDatabase objects generated by passing NULL to the recordset constructors (the tables are so small that performance is not much of an issue). Anyhow, it's just using the default connect string: _T("ODBC;DSN=mphosp_util") generated by the Class Wizard.

The ODBC connection appears to be working fine, because the other CRecordset objects connected to the native MS Access tables are returning records. So, the CDatabase object is opening. In fact, so is the CRecordset. ...it's just empty.

I have included quite a bit of error and exception handling code, and no exceptions are thrown. The recordset opens without error, but is empty (i.e. isEOF() returns true).

Also, I have recently discovered that Access uses the Borland Database Engine to connect to Paradox tables whenever the BDE is installed. My Customer recently re-worked the Paradox application (which uses the BDE), so it is the only driver that could've changed. The ODBC connection, and the CDatabase query timeouts are both allowing more than enough time for the query to execute(15 seconds), but the BDE may be timing out, or bogging down, because the Access query is based on two remote Paradox tables. Do you think that the BDE could be the problem? If so, does anyone know how to configure it?

Thank you for the replies.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top