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.
Related
Coming from the world of MySQL, Postgres, MongoDB, Oracle, etc... I've just been given an MS-Access 2003 database with an application inside it; I need to document it.
I'm not worried about the Tables and relationships -- all standard stuff (except for the linked tables to go to outside data sources via ODBC); I'm noting Queries, Macros, Forms, Modules, Reports, and Pages. I'm not necessarily concerned about the data, and although the schema would be nice, it's all the other Microsoft "extras" that MS-Access provides.
At the moment my strategy is to manually build a list of each item and copy'n'paste each query and chunk of VB Code. (ugh) That's
Then it struck me, perhaps there's an MS-Access wizard who knows a faster way to get MS-Access to dump its guts in a more human readable format. At the moment, I can't even select more than one item, nor paste it into notepad.
See this SO post with a customized VBA routine to export all Access objects as raw texts.
It uses the VBA method Application.SaveAsText (an undocumented option).
Conversely, you can use Application.LoadFromText to re-create objects from text file exported using SaveAsText.
I have a Database which was created using Java DB, Would it be possible for me to manipulate this Database using access?Ive tried using the wizard but it asks me for a dsn and I cant seem to figure out where to get that from
Edit: I would like to modify the database from both MS-Access and javadb
The tables are (relatively) simple currently & it contains 2 relationships; one to zero/one and one to many
Should I convert it to csv and then after I'm finished convert it back to Java DB again?
There are several options. If you want to be able to modify the database from both Derby and MS-Access, then you will need to locate an ODBC driver for MS-Access that would enable it to read and modify a Derby database. Off hand, I do not know if such a driver exists.
If you wish to simply convert the database to an MS-Access format, then ...
... much will depend on the structure of the underlying tables and how much of the schema you need to preserve.
The simplest thing would be that you have a database consisting of a single table that resembles a flat-file database. In this case, you can write a simple JDBC tool to write your database out as a CSV file (for example) that MS-Access can read.
If you have multiple tables or data that can't be easily represented by a CSV file, then things become more complex. You haven't told us anything about your needs or the structure of your database, so it is unlikely that anyone can be more specific.
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.
I currently have a database in MySQL, which I'd like to import in MS Access.
Is it possible to do this while keeping all relationships intact (i.e. without exporting to .csv, or by using ODBC)?
I'm a noob in this area so any help is greatly appreciated.
Thanks.
You need to solve two different problems:
Creating an empty MS Access database with a structure that matches the MySQL database structure.
Extracting the data from MySQL and loading it into MS Access.
This is not easy because different SQL databases offer different structural features, different datatypes, and so on. The more complex your use of MySQL is the more likely you'll run into some show-stopper during the conversion (for instance, Access doesn't support triggers at all). Conversely if you're using MySQL as a simple data store you may find the conversion fairly easy.
To get an MS Access database with the same structure as your MySQL database, your best bet is to find a database definition / diagramming tool that offers reverse engineering and supports both MySQL and MS Access. Use it to reverse engineer your MySQL database into a database diagram, then change the underlying database to MS Access and use the tool to generate a database.
Check out Dezign For Databases which (on paper, anyway) offers the features you would need to do this.
To pump the data across, there are any number of tools. This kind of operation is generically referred to as ETL (Extract, Translate, Load).
Do you mean SQL Server? A good starting point might be to check out SQL Server Integration Services (SSIS), which can be used for transferring data around like that.
Google will also be helpful, check out the first result:
http://support.microsoft.com/kb/237980
By the way, you said ".sql" in your question: a .SQL file is a script file, which could do anything from create a database, insert data, drop table, delete data, or given the right permissions, call system procedures and reboot a machine, format a drive, send an email.. Just for ref, .SQL files aren't the storage format used by SQL Server.
While you can script your database's schema into script files via something like SQLyog, you will find that the syntax varies enough from database to database (MySQL to Access, in your case) that you can't directly apply the scripts.
With much effort a conversion script could be created by editing the script (perhaps automated with a program, depending on the resulting script size). I think you would be better served using ODBC to copy the tables (and data) and then extracting and re-applying the relationships from the generated script by hand. Time consuming, but also a one time operation I would hope.
When both systems are the same database, there are tools that can do the comparison and script generation (TOAD for MySQL and RedGate Compare for Microsoft SQL), but they don't do cross database work (at least not the ones I am aware of).
If you create a ODBC DSN, you can use TransferDatabase to import from your MySQL database. You can do it manually with the GET EXTERNAL DATA command (or whatever it is in A2007/A2010) and see how well it works. It won't get all data types exactly right, but you could do some massaging and likely get it closer to what will work best.
Is there some reason you can't just link to the MySQL tables and use them directly? That is, why do you need to import into Access at all?
Access: run query. Just make sure to adapt the SQL code since every RDMS has its own sintaxis (despite SQL being an ANSI standard).
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.