Easiest option to query mdb (ms access) file using smb in Linux - linux

In my workplace the attendance (fingerprint) device uses .mdb file (that stored on Windows PC), and I have a smb account to the network share to that computer smb://10.7.7.x/tas/, inside the share folder contains 3 files:
HITFPTA.ldb
HITFPTA.mdb ==> this one
HITFPTA_History.mdb
What are the easiest option to able to query (in real time) from that file, since our server that should do the query uses Linux (ArchLinux)? (if possible using Go programming language)

For read-only access to a "live" .mdb database from a mix of Windows and non-Windows clients I would recommend using Java and the UCanAccess JDBC driver (details here). If you're not keen on writing Java code but have some familiarity with Python then you could use Jython as described in my other answer here.
(Jackcess, the data-access layer used by UCanAccess, does not use the Access Database Engine and is not intended to make updates to a live multi-user database. However, it should be able to read the database without incident. For reporting purposes it might be prudent to take a copy of the .mdb file and run the reports against that. Or, stick with Windows clients and use ODBC.)

Related

Fetching Data from power BI XMLA Endpoints from Linux

Can any help me in fetching data from power BI endpoint without the need of using Power Shell, as want to know a way of directly fetching in Linux only?
I know a power shell can be installed in Linux , but is there any way I can skip and directly fetch the data?
reference - https://learn.microsoft.com/en-us/power-bi/admin/service-premium-connect-tools
Your Power BI XMLA endpoint is accessible through your Azure Analysis Services (AAS) instance tied to the given datasource/workspace, which means that you should be able to connect to that AAS instance and work with the data there via the web. I am not aware of any currently available Linux compatible tools that allow this. I did a bit of research and was surprised to find that there was not a VS Code extension that allowed this (might have to get to work on that ;)).
That being said, Microsoft has several different client libraries (for both AMO and ADOMD.NET) built within their .NET Core framework that would theoretically be able to used by a client application that could be built for supported Linux OS (Microsoft doc here). In other words, (again, theoretically) it should be relatively painless to build a simple tool for a supported Linux OS that takes in XMLA commands and executes them on a provided connection.
EDIT: Another good option to consider might be Microsoft's Power BI REST API (documentation here). If the functionality you are looking for is available within their REST API, you should be able to write a client tool (using one of many different options, but .NET Core could still be the in there) targeting Linux that makes use of the API for your Power BI instance in place of directly using the XMLA endpoint. I would consider this the better alternative. This is going is a less 'Microsoft-y' way of doing this, and is going to be much easier to maintain and develop over time. I would start by confirming that the functionality you want is not available in this API first.
EDIT: After reading further in above linked document regarding AMO and ADOMD.NET client libraries:
TCP based connectivity is supported for Windows computers only.
Interactive login with Azure Active Directory is supported for Windows computers only. The .NET Core Desktop runtime is required.
So it looks like there are currently some limitations to these libraries regarding a Linux runtime. I am not positive that you could use something other than TCP based connectivity to accomplish this, but if I find a way (or someone is able to suggest something), then I will update.

NoSQL database: ArangoDB

I have been looking for a database that can be embedded and also be file-based, like Sqlite.
I wanted a NoSQL type of database with this kind of feature.
The language is Python, and ArangoDB has binding for Python, and many other languages.
I am finding conflicting facts about ArangoDB.
In some cases I have seen articles say it is not an embedded DB, or can't be embedded, then see others that imply it is embedded.
Also on the website it says that it stores its data in a special binary format, and then I see an article saying its mainly an In-Memory database.
So its been very confusing.
1)So the question is, can this database run embedded in a python app?
If not, if it runs as a separate process, runs as a server, can this be generated/managed in Python with "zero configuration" on the part of the user, for the sake of deploying a desktop app based on this.
2) Does the database data etc get stored on disk.
SO that is it!
No, you can't embedd ArangoDB in the way you embedd SQLite.
ArangoDB offers the Foxx framework, which you can use to implement RESTfull microservices in JavaScript close to the database core like you would use python with SQLite. However, with AQL ArangoDB also offers a query language as SQLite does with sql.
There are currently several python drivers available that grant you access to ArangoDB from python in a compfortable manner.
The ArangoDB download page offers several packages, which you could use to deploy ArangoDB alongside your app. We offer a windows zip package that you could install by yourselves without user interaction; For linux distributions you'd probably want to use the respective package for that distribution. Easy deployability is one of our core goals.
Regarding the database and your data itself, this gets persisted to disk. This works via memory mapped files. However, the index and other structures are built up during the startup, which is why we refer to ourselves as mostly in memory.
Regular access to ArangoDB (and foxx) is done via the http interface and you get json documents as response. The drivers abstract that interface for you. If you implement foxx apps, you may need to formulate requests on your own.
ArangoDB Datafiles aren't intended to be moved across machines; though it may work as long as you have the same OS & Architectures on both sides. The proper way of doing this is to use ArangoDump on the first machine and ArangoRestore on the second. These are mostly json inside (one json document per line) so they're portable and even simple to load in python - you could even directly access the dump facility from python, and prepare an email for the user with the content.
The most sustainable way of running ArangoDB would be as a service; please note that you may need elevated privileges to register & re/start new services in Windows. The service then binds a tcp port, which you may access from other nodes in the network.

Can CouchDB actually be used for a desktop application?

I'm hoping someone can validate or correct my conclusions here.
I'm looking into writing a small side project. I want to create a desktop application for taking notes that will synchronise to a web-server so that multiple installations can be kept in step and data shared and also so that it can be accessed via a browser if necessary.
I've kind of been half-listening to the noises about CouchDB and I've heard mention of "offline functionality", of desktop-couchdb and of moves to utilise its ability to handle intermittent communications to enable distributed applications in the mobile market. This all led me to believe that it might be an interesting option to look at for providing my data storage and also handling my synchronisation needs, but after spending some time looking around for info on how to get started my conclusion is that I've got completely the wrong end of the stick and the reality is that:
There's no way of packaging up a CouchDB instance, distributing it as part of a desktop application and running it in the context of that application to provide local storage and synchronisation to a central database.
Am I correct here? If so is there any technology out there that does this sort of thing or am I left just rolling my own local storage and maybe still using CouchDB on the server?
Update (2012/05): check out the new TouchDB projects from Couchbase if you are targeting Mac OS X and/or iOS or Android. These actually use SQLite under the hood (at least for now) but can replicate to/from a "real" CouchDB server. Another clientside alternative that is finally starting to mature is PouchDB, which runs in IndexedDB capable browser engines. Using these or using them to inspire similar port to another desktop platform is now becoming a better-trod path.
Original answer:
There's no way of packaging up a
CouchDB instance, distributing it as
part of a desktop application and
running it in the context of that
application to provide local storage
and synchronisation to a central
database.
At this point in time, your statement is practically correct although it is possible to include CouchDB in an app — for an example see CouchDBX.app which is a thin wrapper around a prefixed bundle of CouchDB and all its dependencies.
The easiest way to build a CouchDB app is to assume that the user will already have a CouchDB server running. This is easier than it sounds, especially with Couchone's hosting or a prebuilt app like CouchDBX on OS X or DesktopCouch on Ubuntu. This latter is especially interesting, because if I understand correctly it is included by default with Ubuntu these days, and automatically spins up a CouchDB server per-user when you query its port via D-Bus. Something similar could (and should) be done on OS X using launchd and Bonjour.
So as you write, you either would design your app to store data in a local format and optionally sync with a CouchDB service you provide or you'd have to build and bundle all of Erlang, SpiderMonkey and CouchDB together with your app along with some scripts to make sure it was running when needed. This is possible but obviously neither of these are ideal, and believe me you're not the only one wanting a simpler solution for desktop-oriented apps!

Windows Media Server Streaming from database

Is it possible to somehow set up WMS to stream the content from a database only using Windows Server 2003 Standard edition?
I know it can be done using custom-plugin data source but that is only enabled with Windows Server 2003 Enterprise Edition.
Sorry to be the bearer of bad news, but your best bet is probably:
Maintain copies of your data outside of the database (I don't know the details of your setup, so this may defeat the purpose of what you're trying to do). Basically, keep a file cache of the content you want to stream and write an application to keep the file cache synchronized with the database.
Switch to Windows Server 2008. The Web Server and Standard editions for 2008 support custom plugins and should be much more affordable than the Enterprise editions (I believe the Web Server edition is under $500).
Maybe someone else has some clever solution, but these are the only options I'm aware of.
There is nothing that ships out of the box but WMS does support additional custom plug-ins. From a performance perspective you might want to consider why you need to do so. The easiest way in my mind would be to write an HTTP wrapper around the database and use the built-in HTTP streaming data source. The knowledge and skills required to write the HTTP wrapper is more plentiful than writing WMS plugins. If you do have a use case for this consider SQL Server 2008's filestream feature as it is designed for giving you the relational power with file system performance.

how to use an MS-Access file from Linux?

I'm studying an introductory course in databases and one of the exercises is to work with MS-Access. However I'm using Linux at home and although I can use the computer classes at the university it is far from convenient (limited open time - my studying time is mostly nights).
So how can I use an Access file (*.mdb) in Linux? By use I mean changing tables, writing queries and so on.
Are there tools to convert it to another database format (mysql, postgresql or even gadfly)?
Also what problems may I encounter?
Although a bit dated, I've had good success with mdbtools which is a set of command line tools for accessing and converting Access databases to other formats. I've used it for importing databases into PostgreSQL.
If you're running an Ubuntu variant you can install it with:
sudo apt-get install mdbtools
or you can download it from here.
You're out of luck. Access has no real equivalent on Linux and while Kexi is an interesting alternative that can import Access files and aims to provide similar functionality, it doesn't actually uses Access files once the data is imported.
If your assignment is to develop an Access application with forms etc as opposed to just using and mdb database as a store, then you can try a recent release of Wine with a compatible Access version (see compatibility list) or, even better, find a Windows machine where you're sure it's going to work.
Not to be forgotten, the use of a Virtual Machine loaded with Windows would help you achieve the same thing on your Linux box.
I am currently trying Access with Wine on Ubuntu and I seem to be getting there. I have found that I need to copy various dlls manually, but that could easily be lack of reading up on the subject.
From the documentation: Connecting To Microsoft Access. However, this seems to indicate that you need access running in a windows host and connect via ODBC... See also Known Problems.
I recently discover https://dbeaver.io/ which is a software (in java) to manage different database types (MySQL, PostGreSQL…), a bit like phpmyadmin (but as a host based soft, no server require) and it can manage MS Access excep if version is too old (it is probably my case)
You can work with Access through a connection (ODBC or OLEDB), as long as you only need to manage the "database" dimension of the file (tables and views, which are called "queries" in Access).
Once the connection is open (see here for connection strings), you can send SQL commands to your mdb database, such as (where cn is here a connection object):
cn.execute "CREATE TABLE myTableName (myTable_id autoNumber, myTable_code Text, ...)"
Please note that MsAccess uses a specific DDL that looks like the standard T-SQL but is not really it. Check the syntax in MsAccess help.
Depending on your database (and its constraints, default values, primary keys used, relations, data validation rules, aso), transfering Access can be easy and straight or might not even be possible. You will encounter a problem each time your database implement an access-specific/non-standard SQL rule.
If you really need to convert your access data to something else, I'd adise you to (1) export it under MS-SQL (the free version will be ok, an upsizing wizard is available in Access or on this site), (2)use an additional tool like this one to generate a "CREATE DATABASE" SQL Script, including or not data inserts, (3) use this script to try to create the database and its data on another database server.
If you've got an assignment to work with Access, then frigging find a Windows computer and do your exercise on the native platform for Access. It's completely senseless to do anything else, as you won't be learning anything useful about Access.
If the assignment is to use a Jet data store, then that's something of a different story. And if it is, then you should have worded your question differently. I wouldn't recommend using Jet on anything but a native Windows file system. Certainly if the project is to actually read/write data to a Jet data file then you're not really fulfilling the assignment if you're not using Windows at least as the ODBC host.

Resources