CDaoDatabase Open Jet Database Crashing
-
Hi everyone. I have an MFC app which usesDAO to access Jet/Access databases. The development machine is Win2000 sp3 with Visual Studio 6 installed. The app is statically linked so MFC DLL version conflicts shouldn't be an isue. The app works 100% of my development machine, but I tried it on a Win98se machine and it won't open a Jet database file. The Win98se machine has DCOM98 and MDAC 2.5 installed on it, and only necessary software installed. Only my app is running whne I tested it. The app runs fine until I attempt to open a database. The code below is how I open the database
CDaoDatabase* db; CEDaoRecordset* rs; CString strSQL; long int lTemp; try { db = new CDaoDatabase(); db->Open(strDBPath, FALSE, TRUE, _T(";PWD=")); rs = new CEDaoRecordset(db); //..
strDBPath is the path to the DB Jet database file, which is known to be valid, and not read-only. Once it hits db->Open() I get an "unknown exception" error and the program closes. I know it could be anything, but does anyone have any ideas as to what could cause this? Did I forget to install something? The app is MBCS based, not unicode. -
Hi everyone. I have an MFC app which usesDAO to access Jet/Access databases. The development machine is Win2000 sp3 with Visual Studio 6 installed. The app is statically linked so MFC DLL version conflicts shouldn't be an isue. The app works 100% of my development machine, but I tried it on a Win98se machine and it won't open a Jet database file. The Win98se machine has DCOM98 and MDAC 2.5 installed on it, and only necessary software installed. Only my app is running whne I tested it. The app runs fine until I attempt to open a database. The code below is how I open the database
CDaoDatabase* db; CEDaoRecordset* rs; CString strSQL; long int lTemp; try { db = new CDaoDatabase(); db->Open(strDBPath, FALSE, TRUE, _T(";PWD=")); rs = new CEDaoRecordset(db); //..
strDBPath is the path to the DB Jet database file, which is known to be valid, and not read-only. Once it hits db->Open() I get an "unknown exception" error and the program closes. I know it could be anything, but does anyone have any ideas as to what could cause this? Did I forget to install something? The app is MBCS based, not unicode.Have you caught the exception and analyzed it? You should be able to get detailed error information if you use try{}catch{} and take a look at the error codes being returned. Are you 100% sure that the database itself was copied over exactly? If both machines are trying to access the same DB, then you may want to look at the DB driver versions installed on each machine. Your development platform may be using different drivers.