I need some clarification. I'm planning to make a Scheduler program where it will fetch data from a MS Access Database, and I also want it to upload the data to a web server (MySQL Database) in JSON Format.
In the first process which is the fetching, I'll use System.Data.Ole.db namespace. This namespace mostly worked in MS Access.
In the 2nd process which is the uploading, I am planning to use FTP protocol and should be JSON Format.
I was just confused with the second step, is FTP protocol applicable for this process? I need some tips and suggestions.
I will make an Android apps to view all the data that will be saved on the web server.
As I understand it, you want to copy data from your local MS Access database to a remote MySql database on a scheduled interval. Next you want to write an Android-app that consumes data from the MySql, this in JSON-format.
It's been a while since I last used MS Access, but I would simply setup the MySql destination table as a "linked table" in the MS Access database, then create a macro in MS Access database to INSERT rows into that linked table. I think that macros can be scheduled.
Alternatively, create a simple VB.NET console application, that reads rows from your MS Access database (as you said, using OleDbConnection), and inserts the rows into the MySql database (MySqlConnection - download from mysql.com). Schedule that with Task Scheduler.
Next, create a simple webpage (I'm guessing that this is hosted by a ASP somewhere) that reads data from the MySql and outputs that as JSON.
Hope this helps!
I suspect that FTP for uploading data to SQL is way out of kilter.
Why don't you simply connect to both the databases using regular connection strings and pull data from one and push to another?
I don't know why you brought in JSON into the equation but if you want to store your data in SQL Server in JSON format you can use JSON.NET or the .NET MVC inbuild JavascriptSerializer to do the job and store the resulting JSON into a regular SQL Server table.
Related
If I have a tool that writes data to Access but one of the tables is a linked table, how exactly is the data written to that linked table? Does the data get off-handed to Access and then within Access, Access handles the writing of the data? Or is a kind of link provided to the tool and then the tool writes directly to the table?
The reason for asking is that I've encountered times where some automated tools that I work with will or won't write to a linked table and I'm curious of how to ensure that data is always written.
Usually, all data is written via the Access Database Engine, unless you're doing something weird.
In most situations, it works like this:
Tool submits a query via OLEDB/ODBC/DAO to the Access Database Engine (DAO360.DLL/ACEDAO.DLL)
Access Database Engine determines which data should be read/written to where (to the file/remote data source)
Access Database Engine uses the connect property of the linked table to try and open a connection if necessary, and creates a new query or multiple queries in the appropriate SQL dialect
Access Database Engine submits query/queries via the opened connection
However, this can go wrong:
The tool doesn't actually use the Access Database Engine at all, but tries to directly write the file (via UCanAccess/MDBTools/proprietary driver), and those don't support linked connections at all
The connection string in the linked table requires an ODBC driver, password, resource, or something else that's not present or not in the right place
The linked table requires some sort of implicit authentication (e.g. SharePoint), and this doesn't happen
The data source used by the linked table requires a specific lock type (e.g. dbSeeChanges for opening a Dynaset-type recordset on SQL server) which is not used by the tool
And of course, many, many more things can go wrong (in fact, I crashed Excel in an attempt to test reading a linked SharePoint lists while writing this answer).
I am creating a MYSQL database. I want to be able to have a table that is essentially a live link to an MSAccess database used elsewhere in the business. That would provide the core users/clients information and then I would use that to drive the functionality within the new database. I can connect MSAccess in MySQL or import it, but is there a way to do it as a linked table into MySQL
Edit: Just to make it clear- the MYSQL needs to pull the data from the MSAccess dB
Business wise you have to make a feed API online that gets information from the mysql DB in feeds form (either json or xml).
second step is to read from the feeds and insert or update your data in the MSAccess
I use PHPExcel to upload Excel data into MySQL.
I also have data in MS Access that I want to upload to MySQL.
Is there somehow that MS Access can export a .xls file and save it on webserver and process with PHPExcel?
I cannot use database connections: Access -> SQL.
While Access can export table or query data to Excel using the TransferSpreadsheet, consider directly connecting a PHP script to MS Access importing data into an array and then appending data to MySQL.
Fundamentally, Excel is not a true relational database but a flatfile end-use document like a Word or PDF or XML file. Many use Excel as a database due to its popularity and user-friendliness. But ultimately, it is not an efficient, scalable medium between databases.
Furthermore, Access should not be regarded as a synonymous data store like Excel. It is truly a different product equipped with a front end GUI designer, query processor, report generator, all running on the Jet/ACE SQL engine. Therefore, PHP, Python, R, Java, C#, VB, and other programming languages can connect and query Access databases just as they can with SQL Server, Oracle, DB2, MySQL, PostgreSQL, SQLlite, and others.
I have been building a grails application for quite a while with dummy data using MySQL server, this was eventually supposed to be connected to Greenplum DB (postgresql cluster).
But this is not feasible anymore due to firewall issues.
We were contemplating connecting grails to a CSV file on a shared drive( which is constantly updated by greenplum DB, data is appended hourly only)
These CSV files are fairly large(3mb, 30mb and 60mb) The last file has 550,000+ rows.
Quick questions:
Is this even feasible? Can CSV be treated as a database and can grails directly access this CSV file and run queries on it, similar to that of a DB?
Assuming this is feasible, how much rework will be required in the grails codes in Datasource, controller and index ( Currently, we are connected to Mysql and we filter data in controller and index using sql queries and ajax calls using remotefunction)
Will the constant reading( csv -> grails ) and writing (greenplum -> csv) render the csv file corrupt or bring up any more problems?
I know this is not a very robust method, but I really need to understand the feasibility of this idea. Can grails function wihtout any DB and merely a CSV file on a shared drive accesssible to multiple users?
The short answer is, No. This won't be a good solution.
No.
It would be nearly impossible, if at all possible to rework this.
Concurrent access to a file like that in any environment is a recipe for disaster.
Grails is not suitable for a solution like this.
update:
Have you considered using the built in H2 database which can be packaged with the Grails application itself? This way you can distribute the database engine along with your Grails application within the WAR. You could even have it populate it's database from the CSV you mention the first time it runs, or periodically. Depending on your requirements.
I have a database (mdb file) that I am currently busy with. I would like to know if it is possible to generate MySQL code that would be used to create this database?
There are a couple of tools you can look at to try to do the conversion.
DataPump
Microsoft DTS (Nos Called SQL Server Integration Services)
Other option might be generate MySQL code from Access' DB MetaData you can access from JDBC, ODBC, ADO.NET or any other database access technology with metadata support. For this option you need to generate a piece of code (script). So it will only make sense if your access DataBase has a lot of table with a lot of columns or if you are planning to do this task several times.
Of course, using one of the mentioned tools will be faster if it works.
You can certainly write DDL to create and populate a MySQL database from the work that you've already done on Microsoft Access. Just put it in a text file that you execute using MySQL batch and you're all set.
If you intend to keep going with developing both, you'll want to think about how you'll keep the two in synch.