link access 2007 into mysql - mysql

I have an Access file on a server which my colleagues will update regularly and sometimes I need to analyze the data by the following method:
download the Access file to my local drive
export the table to MySQL
open the MySQL table through R to do the analysis
This workflow is OK if I only have to do it once, but it's getting more often that I find data is missing inside the dataset, I asked the colleagues to fix it, and then I need to go over step 1-3 again, and I feel it is kinda dumb to do the 1-3 steps over and over again.
Since the Access file on server is password protected and I don't want the mess with that file, I wonder if I can created another Access file, that acts as a link between my local MySQL server and that Access file. When I launch R, data will be extracted from the MySQL server, go to my "link" Access file, and go to the Access file on server, and everytime the data I get from R is the latest version.
I wonder if I have explained it clear enough, and I have no clue how to work this out, can anyone here inspire me? Thanks!

Try:
> install.packages("RODBC")
> vignette("RODBC")

Related

Empty Object Explorer When Opening a H2 embedded database(.mv.db file) in DbVisualizer

EDIT: Please ignore the Database Type "MySQL". I have it set to H2 currently, I was just playing around with settings at the time of the screengrabs in an attempt to see if I could pinpoint what was going wrong.
My friend came to me tonight with an "Opportunity". He had a college student code a front end application to insert, update, delete, and view data on a local drive for a small company that he runs. The application broke when he updated windows, and now he needs to retrieve the data. He sent me the .mv.db file, so I did some digging and found that DbVisualizer could allow me to atleast use a simple MySQL query to pull his data out into an excel spreadsheet. According to him, there are only about 300 records in the database.
When I connect to the embedded H2 database, it opens up two empty databases.
Let me know if anybody knows what to do here. Thanks.
I ran into the same problem. Luckily my database was small as well so I could use SQuirreL SQL Client to open the database. It is not easy to get used to the user interface but it does a really good job.
If you want to export your data you probably want to change the settings (File -> Global Preferences, Tab SQL Script). I unticked the box 'Qualify .. with schema' to get valid SQL.
Also the date format is not standard conform. I used a text editor to get executable SQL.

I have copied database folder from wamp/bin/mysql/data

I have copied database folder from wamp/bin/mysql/data
As I open the phpMyAdmin, I see the database name, but when I click on them it is empty, as if no table has been created in them.
Where are my tables now? thanks
Copying the MySQL data directory is not a reliable means of backing up or moving your databases. The supported means is to export then import on the new server. There are a number of things that can go wrong, especially if you have InnoDB type tables.
The basic things you can check are file permissions on the new data directory, MySQL-level user permissions (assuming you're not already logged in as an administrative user, try doing so and see if things improve), and looking in the MySQL error log for any hints if there's something obvious, but it's very likely that something didn't transfer well.
I recommend that you go back to the original installation, verify your data, do a complete export (or "dump") to SQL format, then import that file to your new server.

Explore database contents from .sql file

I inherited the maintenance of a small web forum. Near as I can tell, it is powered by a MySQL database on the backend (the frontend is all PHP).
I need to extract some of the data (which also involves searching for the data I need to extract), but I don't want to touch the production database. I exported a database backup, which produced a several-hundred-megabyte .sql file.
What's the best way to mine these data? I can see several options:
grep through the .sql script in text mode, trying to extract the relevant data
Load it up in sqlite3 (I tried doing this, but it barfed on some of the statements in the script and didn't produce any tables. I have no database experience whatsoever though, so I haven't ruled it out as a dead end just yet).
Install MySQL on my home box, create a database, and execute the .sql script to recreate the data. Then just attach some database explorer tool.
Find some (Linux) app which can understand the .sql file natively (seems unlikely after a bit of Googling).
Any pointers to which of these options (or one I haven't thought of yet) would be the most productive?
I would say any option might work but for data mining, you definitely want to load it up in a new database so you can start query-ing the data and building reports on the data. I would load it up on your Home box. No need to have it remote.

MS-Access - Easiest way to automatically extract a table

Here's the background for my question:
My program will be getting a new copy of an MS-Access database every night, and I need way to automatically pull data from one table of out it. (Preferably using Python).
I don't know much about Access but so far I'm thinking I could save the file on a windows computer, (launch it?) and access the data via ODBC. Would that work, is there an easier way? How would I automatically launch it and start ODBC running?
I'm open to other suggestions, for example is there a way to parse the Access file directly? Or run an export script from within Access?
You can read data in Access using ODBC without opening it. You just need to know the file location, and the connection string. Then read data from your table using SQL commands.

Don't have exclusive access to database and so cannot save changes

I'm working on a MS Access database. I've made some changes to one of the modules. I want to go out for lunch, but when I try closing the database, I get the following message:
"You do not have exclusive access to the database. Your design changes cannot be saved at this time. Do you want to close without saving your changes?"
I'm pretty sure nobody else on the network has the database file open, and I don't have any other Access databases open. I'm probably missing something obvious, but would really appreciated some help!
Update:
In the end I copied all the code, closed the database without saving, re-opened it and pasted the code back in. I was then able to save the database. I'm not sure if this was a one off, but I'll report back if it happens again.
If you're sure no one else is in the db but you, it's an additional connection to your db from your own pc. You can verify this with the LDB viewer, downloadable in the free JetUtils.exe download from Microsoft:
http://support.microsoft.com/kb/176670
Look through your code and check if you have two separate database objects in the default workspace or another database object in a separate workspace. That will cause this problem.
To fix it, make sure the database objects are set to nothing before they go out of scope, and if you opened the database object in code, you also need to close it before setting the database object to nothing.
=============================================
Update in August 2022:
The MS link above no longer works. The document remains available on Archive.org, but is outdated. A document that appears to provide the current version of its information is at:
https://learn.microsoft.com/en-us/office/troubleshoot/access/determine-who-is-logged-on-to-database
This provides VBA code for a sub to obtain a list of users. The writer of this update has tested that code successfully in Access 2019.
If you close the database and are sure nobody else has it opened, check to see if there is a .ldb file (it will have the same name as your database file). If the file is there, then there is a good chance it is still in use.
Is it being access by a service, like a website?
You could copy the database to another sub-directory and make your changes. If that doesn't work, I will have to look that up. Of course there is always the database tool, "repair and compress database..."
Is the file located on a file server? If so check to see if any users have a file handle to it.
If it still doesn't work, update your post with your new information and we'll go further.
UPDATE (9/26):
Another thing I do when having strange issues with access databases with contain vba code is decompile. I don't know if this is documented yet, I haven't looked in years, but it's was (at least) an undocumented switch to msaccess.
From a cmd line:
change directory to where msaccess.exe is located.
Run the following command
msaccess \path to access file\databasefile.mdb /decompile
usually runs very quick then opens the database. Open any module and compile.
Doesn't always work, but sometimes can remove strange happenings.
Did you ever trying to copy the database to another directory and making your edits? That should of worked; you could then rename the original and copy the file back.
Anyway, I am glad you are working again.
If even a word mail merge is linked to the access database, that counts as an access connection.
Very simple.
Close all of your MSaccess files.
Open task manager (by right click on task bar).
Select Processes tab in that.
If the list has a msaccess*32 process close that by clicking on End Process.
This worked for me. I think it closes all the recordset which we have not closed in the codes or which is closed forcefully.