CakePHP use MS Access database (.mdb, not accdb): Do I need to write a driver? How to build it? - cakephp

I'm in the unlucky situation where my client requires to use a read-only MS Access database to render some webpage contents on his website (built by me).
Because this MS Access file will be updated roughly once per month and I don't want to do it manually by converting it into sql query and import in Mysql, I would like to make some webpages read directly from it.
What I discovered is that there isn't a driver (at least in my cakephp installation) for MS Access database (but in older versions of cake exist) or at least I didn't find any of them.
I need to know where eventually I can find such drivers or how to correctly implement one of them only for read operations (I think I should implement DboSource class, but I don't know what should I override because there isn't anything such virtual or abstract or interface that guide me through this).
I didn't even understand if I should create an Adodb driver or an OleDB driver. I also think that Sqlserver driver is a lot similar to what I should build (except for connectionand some details); if I can use it in some way to shorten my job, it will be helpful.
Edit 1:
Because no one is answering, I can say I'm ok to use MS Access also with "normal" queries (without requiring each table to be bound to a model) but I must be sure that are sanitized and will output arrays similar to what cakes output actually: $jobs['jobs']['name']
Any suggestion on how to achieve this?

Maybe the Adodb or Odbc datasources from https://github.com/cakephp/datasources/tree/2.0/Model/Datasource/Database work with MS Access?

This example is to big to write here it-s from cake bakery Please test it and i'm here for other problems

Related

Delphi, Microsoft Access 2007 Connection String

I've been trying to create a program that creates a database, creates tables, stores information in these tables, and reads off these tables. I am using delphi and microsoft access (although I am open to using another database program if one is easier to learn). Anyway, I cam across this question and answer: Delphi 7: ADO, need basic coding example
However I am confused about what my connection string would be or how to know what is is. I want the database saved in the same file area as where my program is so would it just be the file directory to that area such as:
FILE NAME=E:\project\Debug\Win32\Studentdb.accdb
Also the user uses +database. If my database name is Studentdb would I just put 'Brill1' in that space or not?
Also do I need to use ODBC connector if I am not using MYSQL? I am guessing not but do I need to use something else. Also, while saving files from microsoft access they save as .accdb however when I created a ADOConnection component on my form and pressed into the connection string property it was asking for a .udl and I haven't run across this anywhere before so I am wondering if I need to convert or do something with that.
I am a real beginner with this so I am sorry if my questions are obvious but I would really appreciate some help or pointed to a beginner's friendly resource on the subject. Thank you.
All possible connection strings from Access 2007 are here:
https://www.connectionstrings.com/access-2007/
...which one to choose depends on which driver you have and/or want to use.
(ACE, OLE, ODBC ...)

Work with Database using Spock and Geb.

I hope someone have already faced an issue to verify that application shows correct data from database. I reviewd how groovy used SQL, but I have no idea where and how I should do that. I'm just starting to use gradle+Spock+Geb for testing application. I have a few files where I described a couple of pages from application, a couple of modules and a file with spock specification. Where and how I need to connect to Oracle DB, use SQL and compare result's data with application's ones?
P.S. I write everything in notepad++ and launch from command line writing 'gradlew firefoxTest'. Does exist any more comfortable way to work with gradle+spock+geb?
Thanks in advance.
Because there are no other answers, I wanted to provide a solution someone at my company thought of. This assumes you already have a project that uses some sort of JDBC. In our case it is JDBI.
The idea is to extend Classloader and then use that to directly access the data access object class via the JVM. That idea should work.
I have not tested it out because it doesn't completely fit our use-case. I'll admit that this does not completely apply to your use case, but technically you could just run the jar of an existing project, which can access the database.

Issue With DAO 3.6 on VB6 database

I am currently in the process of trying to launch a database that has a VB6 front end connected to an access 2000 database. On certain computers we are experiencing a problem where the data being pulled from the database does not show up or does not show up correctly.
The computers that work seem to have the same dao360.dll date modified in both the system 32 and microsoftshared/dao while the one that are not working do not have the same date modified.
Is this whats causing the error? How can I correct this? Or is it something else that is happening?
There shouldn't be two copies of the DLL on the system. It sounds like a poorly designed install of some application had been previously done on these systems. There is no telling what the full extent of this has been.
Packaging as an isolated application can insulate your programs from these kinds of bad installs that create DLL Hell. Sadly MDAC/DAC and related components are very difficult to isolate.
This is another reason to have moved to ADO back in 1998, if not in the time since then. While you can't isolate the ADO-related parts of MDAC/DAC any more than you can DAO, those libraries are now shipped as part of Windows. You don't need to deploy them and they are protected from bad installers by the increasingly better system file protection mechanisms in Windows.
However providing specific assistance will probably require a more specific and detailed description of what is going on than "does not show up or show up corectly."
I'd create a minimal test case using DAO to begin exploring where (and what) the problems really are. To begin with perhaps just a simple query displaying the returned rowset without data binding.
I suggest installing the latest version of MDAC and Jet. While Jet used to be a part of the MDAC, I'm pretty sure they dropped it into its own installl/update/service pack at this point. Perhaps start here: http://support.microsoft.com/kb/239114

How do create a custom database driver for CodeIgniter

How do you create a custom database driver to extend CodeIgniter's functionalities to other types of database systems? I'm using iRODS (www.irods.org). I have a version of the site created using MySQL, but I want to be able to change the database backend with minimal changes. Is there an easy way to add this function, like how you can add a custom library in CI? I haven't been able to find any so far.
I'm assuming you mean how do you create a custom Active Record driver for codeigniter? Otherwise I'm probably far off the mark here but:
There is no way I know of to simply extend or override the DB classes it is not a common thing. You can implement your own and patch up your CI config to use the new DB though.
Under system/database/drivers you find all the AR driver source. You would need to reimplement each function in each of the four files (may be able to skip on forge if you don't use it.)
I'd use the MySQL driver as a starting template as you mention you already use that, in which case you'll want to make sure all the features you use are re-implemented.
It sounds like a daunting task if you're not too experienced but I assure you the code is pretty simple.

Export from Intersystems Caché database

I have a product based on Intersystems Caché database, I can see no classes, no schemas, no tables, only globals. Is there any smart way to export data from these globals and get "human-readable structure"?
First question is... what version of Caché?
Second question is... what tools do you have access to? Terminal, Studio, Management Portal??
If the data is in tables/classes, you should be able to access it via ODBC, at least.
If there aren't any tables/classes, the data is probably in Globals.
If the data is in Globals (persistent sparse array storage) they can look a bit wierd if you aren't used to the common patterns.
Even if it is in Globals, it may be possible to define classes with custom mapped storage to make them appear in a table-like way via SQL.
Cache is EXTREEMELY flexible, but can be a steep learning curve. :-(
Globals in Intersystems Cache is schemaless type of storage, so the best "human-readable" format you can have is that one in System Management Portal.
Other options are:
* zw command in terminal
* d ^%G command in terminal
Are you able to view the Cache SMP or connect to the database using Cache Studio? I would think you'd find code somewhere in there (at least a bunch of routines if they're not using classes). Using the SMP to browse the globals is a good way to get familiar with the datasets they contain. From a terminal session, you can use the zw command to take a look at global node contents:
USER> zw ^GlobalName
http://docs.intersystems.com/cache20082/csp/docbook/DocBook.UI.Page.cls?KEY=RCOS_czwrite
Can you give a little more information about your situation?
Depending on the structure of your globals you could create classes for them and edit the storagemapping to point to them. Based on that you then could go ahead and create reports/(zen/csp)webpages to display the contents. However, depending on the complexity of your data this could take you anywhere between hours and months :/
My experience is to use Navicat Tool and export database Caché into a MySQL schema or Postgres to understand DB Model, using import Tool via ODBC.
ODBC works with cache. You can use the ODBC connection to export the data to another strucutre such as a set of free tables or text files.
You can use a system utility called D ^%GO which is Global Output. You specify the global(s) and the file you want them exported to. There’s also a ^%GI for global imports from this file

Resources