How to configure Squirrel SQL client to work with MS Access - ms-access

I'm struggling to get Squirrel SQL to connect to MS Access database (just a normal one, no password):
I create an Alias and use Driver: JBDC ODBC bridge (There is a tick in front of this driver)
I don't know what to put in URL
-------- I use: Path to database file ~~> Unsuccessful
-------- I use: jdbc:odbc:Path to database file ~~> Unsuccessful
I'm running it on windows 7.
I guest this should be a simple straight forward process, but please advise me how to get it working.

Now that the JDBC-ODBC Bridge has been removed from Java 8 the previous answer to this question will become less relevant over time. The following method uses the UCanAccess JDBC driver so it will work with Java 8 and it will also work on non-Windows platforms.
First, make sure that you are using UCanAccess version 3.0.5 or later. Download the latest version of the UCanAccess driver (bin.zip file) and unzip it to a convenient location. For this example I unzipped it to
/home/gord/Downloads/JDBC/UCanAccess
Note: When unzipping the distribution file be sure to specify "Keep directory structure" (or similar, depending on your unzip tool) so the folder structure appears as in the screenshot above.
Creating a Squirrel SQL "Driver" entry (one-time setup)
In Squirrel SQL, create a new "Driver" entry for UCanAccess
and specify the location of loader/ucanload.jar on the "Extra Class Path" pane
Note: Remember to enter net.ucanaccess.jdbc.UcanloadDriver as the "Class Name" (see above).
Creating a database "Alias" (one for each database)
To open a specific database, create a Squirrel SQL "Alias" entry, replacing the <path_to_database_file> placeholder with the actual path to the file
or, in Windows
Important: Make sure that the connection URL ends with ;showSchema=true.

I found the solution. Put below string in URL:
(Assuming that path to your database file is D:\DBs\DatabaseFile.mdb)
jdbc:odbc:Driver={Microsoft Access Driver (*.mdb, *.accdb)};Dbq=D:\DBs\DatabaseFile.mdb

Related

Where are ODBC Machine DSN settings stored in Windows?

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

How to figure out from Microsoft Access Connection String for linked table where the data is coming from?

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.

How do I connect a MS Access database to Jetbrains DataGrip

I have been using DataGrip for a couple of weeks now and I like it a lot.
The only thing I am unable to find out is how to connect DataGrip to a MS Access database.
Could someone explain to me how to do that?
For Future readers this is still very doable (I'm on DataGrip version 208.1.4):
Get UcanAccess
Download and extract UcanAccess somewhere: pathToUcanAccess
In Datagrip goto add new connection: "Driver And Data source"
this will create a connection "Database Driver -" and a Driver "Database Driver"
Edit the newly created Driver "Database Driver":
Under Additional Files add:
<pathToUcanAccess>\ucanaccess-4.0.4.jar
<pathToUcanAccess>\lib\commons-lang-2.6.jar
<pathToUcanAccess>\lib\commons-logging-1.1.3.jar
<pathToUcanAccess>\lib\hsqldb.jar
<pathToUcanAccess>\lib\jackcess-2.1.11.jar
For Dialect select "SQL Driver"
Hit Apply (this should load the classes from the added files)
Under the class combo you should now see net.ucanaccess.jdbc.UcanaccessDriver, select it and hit apply again.
Under Url templates add a new template, for name enter "default" for template enter jdbc:ucanaccess://{file::identifier.sqlite};newdatabaseversion=V2010
Hit apply.
Now edit the database connection "Database Driver -":
Next to the text box for url, in the drop down select default (or what ever you named the template in step 3.5)
A file select field should replace the previously visible "user" and "password" fields
In the file selector, select your mdb
the url field should now look like jdbc:ucanaccess://C:/data/MDBs/myMdbFile.mdb;newdatabaseversion=V2010
Hit apply and then ok.
You should see your Connection popup in the list, double-click to connect, expand it down the tree ("Public \ <unnamed> \ tables") and you should see your tables.
Inspired by this question.
As per the documentation, MS Access is not supported yet.
The following standardized and DBMS vendor-specific SQL dialects are
supported: DB2, Derby, H2, HSQLDB, MySQL, Oracle, Oracle SQL*Plus,
PostgreSQL, SQL Server, SQL92, SQLite, and Sybase .
You can try configuring MS Access as an ODBC source and then use a JDBC ODBC driver to connect to it, just like any other JDBC database.

Cannot connect to database via JDBC in Pehtaho Report Designer

So, while trying to connect to Pentaho in Pentaho Report Designer, I am getting an error which says:
Communication failure during handshake. Is there a server running on the host host_name?
using class org.gjt.mm.mysql.Driver
I have now included the jar file mentioned in the first answer and the connection says OK. But, when I preview or use a query using that connection, again I get the same error.
I am absolutely new to Pentaho. I got a few errors before which I could resolve. But, I have been stuck on this one for 2 days now. Cannot find anything regarding this.
May be Mysql connector is not there i think.
=> Before creating jdbc connection. Go to these location Eg:- C:\report-designer-3.9.1\lib and then check mysql-connector-java-5.1.26.jar file is their or not. If it's not their goto these (http://dev.mysql.com/downloads/connector/j/) location and download jar file and copy that file and paste it in C:\report-designer-3.9.1\lib location.
=> Restart Pehtaho Report Designer again and check it now.
=> May be you have lower version of mysql jar file remove old mysql jar file and paste higher version of mysql jar.
I think your problem will be solved.
Thank you..

JDeveloper MySQL error Driver not found

I am running MySQL db using the latest wamp server. Using Oracle JDeveloper 11g. I have placed the MySQL connector jar in .../jdeveloper/jdev/lib folder and added the jar as a library in my adf application .
. I am able to create a connection to the db, view the tables in DB Navigator of JDev, also create Entity and View Objects. However when I try to run the Application Module, I get an error popup saying could not create connection, driver not found. I have the ApplicationModule data source configuration set to JDBC Datasource.
Help!!!
. Thank you
Update :
The Error Log-----------------------------
[232] Using the oracle.jbo.server.ConnectionPoolDataSource to acquire a connection...
[233] Creating a new pool resource
[234] Trying connection/3: url='jdbc:mysql:/*****' user='root' password='*****' ...
[235] DBTransactionImpl.initTransaction: Login failed
[236] java.sql.SQLException: No suitable driver found for jdbc:mysql://127.0.0.1:3306/myDatabase
at java.sql.DriverManager.getConnection(DriverManager.java:602)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at oracle.jbo.server.URLConnectionHelper.getConnection(URLConnectionHelper.java:187)
at oracle.jbo.server.URLConnectionHelper.getConnectionFromDriver(URLConnectionHelper.java:50)
at oracle.jbo.server.ConnectionPool.createConnection(ConnectionPool.java:195)
at oracle.jbo.server.ConnectionPool.instantiateResource(ConnectionPool.java:166)
at oracle.jbo.pool.ResourcePool.createResource(ResourcePool.java:580)
at oracle.jbo.pool.ResourcePool.useResource(ResourcePool.java:313)
at oracle.jbo.server.ConnectionPool.getConnectionInternal(ConnectionPool.java:102)
The username and password used to connect to my database is correct, I am able to test it in the connection manager.
I am getting this error on run of Application Module, so I dont think the Integrated Weblogic Server is an issue here.
I have made sure that in libraries the mysql-connector jar is marked as "Deploy by default".
The jdbc jar file should also be placed where the embedded WebLogic can find it. So locate your defaultDomain directory under the JDeveloper's system directory /users/youruser/roaming/app data/JDeveloper
And locate the lib directory there.
Or make sure that the library you created in JDeveloper for the JDBC jar is marked as "Deploy by default".
put the mysql-connector**.jar in ~/.jdeveloper/xxxxxxx/DefaultDomain/lib
Configure JDeveloper to work with MySQL Connector/J
1-Download MySQL Connector/J 3.0.11 and copy the JDBC driver JAR file to a known location, such as /jdev/lib
From the Tools menu, select Default Project Properties.
In the tree view, select Libraries.
In the right pane, select New. The Create Library dialog will be displayed.
Name the library MySQL JDBC.
Set the location to Users Libraries.
Click Edit for the Class Path. The Edit Class Path dialog is displayed.
Click Add Entry. The Select Path Entry dialog is displayed.
Navigate to the JAR file for the MySQL Connect/J JDBC driver (it should be called something like mysql-connector-java--bin.jar).
Click on the jar file and click Select.
Click OK.
The library will be defined, and it will be in the Selected Libraries list.
You probably don't want that library to be defined in all your projects, so shuttle it over to the Available Libraries list.
this link help me a lot :
Oracle JDeveloper 11g with MySQL