I want to perform JDBC SQL queries on a MDE Access file.
I've set up the data source ODBC and everything worked well for a MDE file.
Now, I'm working with a newer version of the MDE file, and here is the result:
java.sql.SQLException: [Microsoft][Driver ODBC Microsoft Access]
Cannont read record. Read authorization unavailable for "tbl_mytable".
If I open the MDE with Access Runtime I am asked for a password, and after leaving a blank password I can see all the data. Of course, "tbl_mytable" does exist inside the database.
I assume that you did not make the MDE yourself. As David said, there is no advantage to convert a MDB database to MDE if it is just going to be used as a database file and not an application.
Anyway, it looks like some group security was put in place on the new version of the MDE database you are using.
You need to check with the person who created the original database if they set up security so they can give you the proper username and password needed to access it again.
Once you get the username/password, you can either change your ODBC data source settings or the connection string you are currently using, usually by adding a "UID=username;PWD=password;" to it.
Related
In my Access database, I reference the DSN, "mydatasourcename" to connect to an online MySQL database. It is a machine DSN. Somehow through the course of editing my config files, a phantom DSN was created. This DSN is now out of date and I need to update it with the new hostname (after having migrated the MySQL Server). But the config file is nowhere to be found. It does not show up in either 32-bit or 64-bit "ODBC Data Sources" forms. I have searched "mydatasourcename" in the Registry Editor and it is not there either. Mysteriously, when I open an Access linked table referencing "mydatasourcename" it opens a MySQL ODBC Connector dialogue with the old connection information in it. How is it doing this? Where is it getting the connection string information? To answer this question, I am requesting a list of the places the ODBC driver looks for configuration files and how to access them so I can delete the old configuration file. I am using MySQL ODBC Connector 8.0.16. Thank you.
EDIT: The connection string found in my linked table is definitely looking outside of Access for connection info based on the fact that is referencing a DSN. The connection string in one of my linked tables is the following: "ODBC;DSN=mydatasourcename;;TABLE=qrychemigationapplications_materialsrequired1"
On Windows, ODBC DSN information is stored in the Windows Registry. System DSNs can be found in the registry keys
DSNs for 64-bit drivers: HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI
DSNs for 32-bit drivers: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ODBC.INI
and User DSNs can be found in
HKEY_CURRENT_USER\SOFTWARE\ODBC\ODBC.INI
If a DSN does not appear in the ODBC Administrator (odbcad32.exe) it might be because the DSN name is not included in the list of DSNs in the corresponding subkey
...\ODBC.INI\ODBC Data Sources
Paths to odbcad32.exe:
x86:
%windir%\syswow64\odbcad32.exe
x64:
%windir%\system32\odbcad32.exe
I was able to find the "Machine Data Sources" that Microsoft Access creates in the Windows Registry Here:
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\ClickToRun\REGISTRY\MACHINE\Software\ODBC\ODBC.INI\ODBC
Data Sources
The "Machine Data Sources" that are in this part of the registry, seem to be accessible only via MS Access. If you look for them instead using the standard Windows ODBC Data Source Administrator "widgets" (32 or 64 bit), you just don't see the "Access Created" Machine Data Sources for some reason. If anyone can tell us why, that would be great!
What's more frustrating, is that at least with the latest Microsoft Access Office 365 version, you can only create NEW Machine Data Sources. You can't delete or edit existing "Machine Data Sources".
That being said, if you avoid creating the "Machine Data Sources" using Microsoft Access itself, and instead use the standard 64 Bit Windows ODBC Data Source Administrator "widget", then for whatever reason Access will see those that you create in this way.
So having the issue that you're describing, just seems to be the result of some weird design that Microsoft has implemented specifically in regard to Microsoft Access ODBC connections, for a reason that escapes me.
Hope this helps!
Below is an alternative to accessing the Windows Registry:
Control Panel
Administrative Tools
ODBC Data Sources (32-bit or 64-bit)
Click the tab for: User DSN, System DSN, or File DSN
Click the name of the Data Source
Click Configure... if you would like to view or modify the details of the data source
I have an old (created circa 1997 I believe) Microsoft Access database that has a linked table, to which only Windows XP users can connect.
When I do the following in the Immediate window
?CurrentDb.TableDefs("my linked table name").Connect
I see the following connection string:
ODBC;DSN=(some data source name);UID=(uid);PWD=(pwd);APP=2007
Microsoft Office
system;DATABASE=(someDbName);Network=(someNetworkName);
I can't figure out based on this connection string where it's trying to connect to. For example, I would expect a machine name instead of a Network name. I tried loading up the ODBC data source administrator on the machine where the connection does work, but I can't see any data source name matching the one above. I'm also not sure what the 'APP' attribute means... is that supposed to be the app from which we're connecting, or the app to which we're connecting?
I suspect that I just need to install a driver, but I have no idea which one to install.
Can anyone suggest a way I can figure out where this linked table is linked to?
I had to find the DSN referenced by the connection string, because it had the server name to connect to (as well as a pointer to a driver). I ended up exporting the DSNs from the registry of a working 32-bit machine, and editing them to go to WOW6432Node of HKLM/Software and imported them to 64-bit machines and installed appropriate driver (specified in DSN) and everything worked.
I have an access database that sits on server x iis is running on server y. One of my web pages access data from the access database. If someone has the access database open say a end user on our network the web pages fail with a ...already opened exclusively by another user error message.
I created a local access database and used linked tables in order to access the tables that way. Even still I get the already opened exclusively by another user error. If I go through windows explorer and browse out to server x and open the database I can without issue. So my question is how can I simulate the same type of connectivity to the database without the error being thrown is it a matter of permissions to the access database or something within my connectionstring that would allow me to access the database.
Since it throws the error during my connection.open command I am figuring it is either permission related or something additional I need to add to my connection string. I have granted full control for the IIS AppPool\ on the local directory in which my local instance of the access database resides in but didn't seem to make a difference.
My connection string looks like:
Private Shared connSheriff As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\serverx\directory\Access\MyDatabase.mdb;Jet OLEDB:Database Password=property;")
There are some options within the mdb that change how the database is opened by default, these should be your first port of call particularly setting the "default open mode" to "shared".
You've already split the database (data tables in the shared back-end, linked tables and the rest in the front-end). Make sure that each user uses a separate copy of the front-end mdb, otherwise you'll get locking issues on this.
There is a command line switch (/excl) that sets exclusive mode, but you just omit this to open the db shared so I doubt this is a problem.
You probably already know this but the "Shared" modifier has nothing to do with sharing between applications or users, but shares the connection variable between instances of your class (the c# equivalent is "static")
I'm trying to connect to an Access database file using a System.Data.OleDb.OleDbConnection. I need to connect in readonly mode because another application uses it at the same time. I can connect to the database in read/write no problem but can't seem to find anywhere the correct string for readonly.
I've tried:
Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Persist Security Info=False;Mode=Read
Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Persist Security Info=False;Extended Properties="ReadOnly=true;"
Thanks.
EDIT:
(I should have put more information in the original question.)
I could connect successfully to the access database when it was on the local machine, but when I tried connecting to the access database on a remote machine with the connection string
Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Persist Security Info=False;Mode=Read
I would get the following error:
System.Data.OleDb.OleDbException (0x80004005): The Microsoft Office Access database engine cannot open or write to the file '{0}'. It is already opened exclusively by another user, or you need permission to view and write its data.
My application is running in a windows service under the local system account.
I think that has to be handled either by user permissions that the DB admin would control, or with different cursor types for your recordsets, which you would control. I don't think the connection string specifies access mode, it just gets you there. ;)
The real problem is that Excel leaves the connection open until the file is closed.
In Excel 2007+, the MaintainConnection setting is set to true by default. You need to go into the vb editor and use code to turn it to false. I haven't seen a way to do this through the visual interface.
Even if you set the connection string to readonly, it will lock an access database (from my experience).
For a pivottable connection:
Sheets("sheet1").PivotTables("pivottable1").PivotCache.MaintainConnection = False
For QueryTable:
Range("A2").Select
Selection.ListObject.QueryTable.MaintainConnection = False
Selection.ListObject.QueryTable.Refresh BackgroundQuery:=False
By setting it to false, the table will connect, run the command, then disconnect, releasing the lock.
I had to work on an already made website, just adding some small module
While i was updating, there was many files called myDB.mdb in the different subfolders
i wanted to make sure that my app is connecting the right database
so i started renaming subfolder...at one of those subfolders, i refreshed,the main site and mine stopped working
i renamed back to the correct name.. refresh... refresh... refresh.. i am still refreshing and i started another browser.. it is giving a connection problem :S
Provider error '80004005'
Unspecified error
/new/conn.asp, line 13
any idea about his :S
would appreciate any help !
I have had the same problem. The first time I loaded a page it worked well, but if I loaded the page again quickly, then I got this error. If I waited for a while then I didn't get the error. It must be because when you call objConnection.Close it takes some time to actually close the mdb file, so if you try and open it again you get the "File already in use type error". Strangely adding a mode to the connection sorted this problem out for me. It doesn't have to be read only, read / write works as well.
objConnection.Mode = 1 ' read only
Microsoft OLE DB Provider for ODBC
Drivers error '80004005'
[Microsoft][ODBC Microsoft Access
Driver] The Microsoft Jet database
engine cannot open the file
'(unknown)'. It is already opened
exclusively by another user, or you
need permission to view its data.
or
Microsoft OLE DB Provider for
ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access
Driver] '(unknown)' isn't a valid
path. Make sure that the path name is
spelled correctly and that you are
connected to the server on which the
file resides.
or
Microsoft OLE
DB Provider for ODBC Drivers error
'80004005' [Microsoft][ODBC Microsoft
Access 97 Driver] Couldn't use
'(unknown)'; file already in use.
From: http://tutorials.aspfaq.com/8000xxxxx-errors/80004005-errors.html
Whatever happened, it is resulting in an 80004005 error, so the problem is definitely a permission issue.
Depending on the configuration of the web server, it may not be the IUSR account that needs the access. I find it's best to fire up FileMon, filter it to the name of my database (with wildcards), and check out the properties of the error that shows up. Viewing the properties will show you the user that is actually trying to access the file.
For Access databases, you want to make sure that you're modifying the permissions of the folder and not the file. You'll need Modify permissions on the folder so that the .ldb file can be created.
Check that the IUSR account has permissions on the Access database and the folders/sub-folders containing it. I've found that on occasion if you rename or compact an access database it loses IUSR priviledges so appears in use / locked
I had the same error on Access DB :
Provider error '80004005'
Unspecified error
Reason was that one of the pages included files was not in the right format (UTF-8) but ANCI
When I changed that file to UTF-8 , everything woked right !
greeting otto
Googled in but the issue was spaces in the filename for my situation. Remove them and no problems. I hope that will help someone else.