Forum > Databases

Using MS Access with KADao

(1/4) > >>

ercolesptr:
I am trying to use KADao Lazarus component available from here( https://sourceforge.net/projects/ka-dao-for-lazarus/ )in order to use MS Access database with DAO. I installed the components without problem however when I try to make a project and use the components I get an error Class not registered. This error occurs when the program runs after compilation which occurs without errors. The error does not occur when I try to run the executable built but it does not seem to work or maybe I am not using it correctly. Can anyone help please?

ercolesptr:
I actually found that the program works well and was able to display the contents of the database in a grid, only thing is that this error occurs at when the program is executed from within lazarus IDE but not when the built exe file is run. Any idea why this is happenening?

wp:
I did this:
- Add a TKADaoDatabase to the form, set its Database property to one of my old Access-97 mdb files, set Connected = true --> ok.
- Add a TKADaoTable to the form, set its Database property to the KADaoDatabase instance added, property TableName lists the names of the tables found in the mdb file, select one of them, set Active = true --> ok.
- Add a TDatasource and a TDBGrid and connect them in the usual way --> DBGrid displays the data of the selected table --> fine!

BUT:
- Trying to compile the project --> Error "Module was not found", raised in TKADaoDatabase.CreateOleDBEngine_II. No idea what's missing... I'm on Win-11. Maybe it does not support DAO any more? But why does it work at designtime?

dseligo:

--- Quote from: ercolesptr on November 17, 2022, 04:27:28 pm ---I actually found that the program works well and was able to display the contents of the database in a grid, only thing is that this error occurs at when the program is executed from within lazarus IDE but not when the built exe file is run. Any idea why this is happenening?

--- End quote ---

Maybe your Lazarus is 64-bit and you compile your program to 32-bit or vice versa and you have only 32-bit libraries (or 64-bit in other case).

ercolesptr:
Mine gives exception error "class not registered" when running from Lazarus IDE, but works fine otherwise and opens the database in the grid. Any idea how to register that class whichever it is?

Navigation

[0] Message Index

[#] Next page

Go to full version