f



Problem while connecting to MS Access 2007

Hi, I'm getting " Data source name not found and no default driver
specified" Error while connecting to MS Access database through
tomcat. I have  created user DSN for my db.
My connection code is:
 Connection con =null;
    try {
        Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
        String conStr = "jdbc:odbc:Driver={Microsoft Access Driver
(*.mdb, *.accdb)};DBQ=" +
            "D:\\OLD D DRIVE\\FileManager\\FileManager.mdb";
        con = DriverManager.getConnection(conStr);
    } catch(Exception e) {
        e.printStackTrace();}
0
ruds
9/1/2012 11:04:50 AM
comp.lang.java.databases 3049 articles. 0 followers. samyaksulabh (16) is leader. Post Follow

8 Replies
560 Views

Similar Articles

[PageSpeed] 10

On 9/1/2012 7:04 AM, ruds wrote:
> Hi, I'm getting " Data source name not found and no default driver
> specified" Error while connecting to MS Access database through
> tomcat. I have  created user DSN for my db.
> My connection code is:
>   Connection con =null;
>      try {
>          Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
>          String conStr = "jdbc:odbc:Driver={Microsoft Access Driver
> (*.mdb, *.accdb)};DBQ=" +
>              "D:\\OLD D DRIVE\\FileManager\\FileManager.mdb";
>          con = DriverManager.getConnection(conStr);
>      } catch(Exception e) {
>          e.printStackTrace();}

Pre-2007 it is:
   .mdb files
   {Microsoft Access Driver (*.mdb)} driver

2007 and later is:
   .accdb files
   {Microsoft Access Driver (*.mdb, *.accdb)} driver

Also be sure that you use 32 bit Java as I believe the
ODBC driver is 32 bit.

Arne


0
ISO
9/1/2012 2:19:18 PM
My CPU is 64 bit and for creating DSN I'm executing "C:\Windows\SysWOW64\odbcad32.exe". I have installed jdk1.6.0_32 version of java.
0
ruds
9/3/2012 5:45:40 AM
On 9/3/2012 1:45 AM, ruds wrote:
> My CPU is 64 bit and for creating DSN I'm executing "C:\Windows\SysWOW64\odbcad32.exe". I have installed jdk1.6.0_32 version of java.

32 or 64 bit Java?

Arne


0
ISO
9/4/2012 2:34:56 AM
I had downloaded the exe file for i586 so ithink it is 32 bit.

0
ruds
9/4/2012 5:02:42 AM
On Sat, 1 Sep 2012 04:04:50 -0700 (PDT), ruds <rudranee@gmail.com>
wrote, quoted or indirectly quoted someone who said :

>Hi, I'm getting " Data source name not found and no default driver
>specified" Error while connecting to MS Access database through
>tomcat. I have  created user DSN for my db.

see http://mindprod.com/jgloss/jdbc.html

-- 
Roedy Green Canadian Mind Products http://mindprod.com
A new scientific truth does not triumph by convincing its opponents and making them see the light,
but rather because its opponents eventually die, and a new generation grows up that is familiar with it.
~ Max Planck 1858-04-23 1947-10-04 


0
Roedy
9/6/2012 11:22:13 PM
On 9/4/2012 1:02 AM, ruds wrote:
> I had downloaded the exe file for i586 so ithink it is 32 bit.

So 32 bit Java and 32 bit ODBC.

And Access must be 32 bit as well as I don't believe a 64 bit version 
exists.

Mysterious.

Can you access it via DSN?

Arne


0
ISO
9/7/2012 12:41:41 AM
yes I'm able to open it and view the contents. Is it required to have a META-INF/context.xml file? would that be a problem?
0
ruds
9/7/2012 3:32:23 AM
On 9/6/2012 11:32 PM, ruds wrote:
> yes I'm able to open it and view the contents.

I meant - can you access it from Java using the DSN?

> Is it required to have a META-INF/context.xml file? would that be a problem?

That is configuration for Tomcat. Including defining data sources.

It is not needed when using DriverManager.

Arne

PS: Using an Access database from a web application usually gives
     problems as Access is not designed for that type of context.

0
ISO
9/8/2012 10:01:23 PM
Reply:

Similar Artilces:

Problem Connecting to MS Access Database
I'm fairly new to VB and was wondering what the connection string for an ADODB.Connection looks like that will open an Access Database with a password???? Thanks!!!! what i have looks like this.... dim localdb as new ADODB.Connection localdb.Provider = "Microsoft.Jet.OLEDB.4.0" localdb.Properties("Data Source") = "c:\test.mdb" localdb.Properties("DefaultUser") = "admin" localdb.Properties("Jet OLEDB:Database Password") = "mypass" localdb.CursorLocation = adUseClient localdb.Open the error i get says "Item cannot ...

Best way to connect MS Access 2007 to Oracle 8 database?
I am new to Oracle. I need to connect to a Oracle 8 database to extract some data. I have read some of the postings and wonder what is the least involved way to connect the two. Is the Oracle OLE driver (not OLEDB) good? I would prefer not install the Oracle client if I don't have to. All I need to do is ,once a day, connect to Oracle, run a passthru query and disconnect. Any thoughts??? Thanks, TD TD wrote: > I am new to Oracle. I need to connect to a Oracle 8 database to > extract some data. I have read some of the postings and wonder what > is the least involved way to connect the two. Is the Oracle OLE > driver (not OLEDB) good? > I would prefer not install the Oracle client if I don't have to. All > I need to do is ,once a day, connect to Oracle, run a passthru query > and disconnect. > > Any thoughts??? > Thanks, > TD Install the Oracle client. Nothing about what you are trying to do is good. Oracle 8 is paleolithic and likely the version of MS Access you are trying to use didn't exist when Oracle 8 did. This is all a remarkably bad idea. What is it you think you are going to do in Access you couldn't do inside the database other than corrupt the data? -- Daniel A. Morgan Oracle Ace Director & Instructor University of Washington damorgan@x.washington.edu (replace x with u to respond) Puget Sound Oracle Users Group www.psoug.org On Dec 20, 9:03 am, DA Morgan <da...

MS Access database connection without connectivity toolkit
Hi guys &nbsp; I'm developing an application that courrently reads data from a *.txt file. I would let the application read data from a MS Access database. Is it possible to connect to MS Acces db and retrieve data without the database connectivity toolkit? The result of second field (column) should be: current record - previous record. How can i do it, even reading data from *.txt data?&nbsp; &nbsp; Thanks for your help &nbsp; beta66 Hi dennis thanks for suggesting me labsql, i dowloaded it. I would really appreciate an exemple on how to calculate (using a *.txt file)&...

Database connection to MS Access & MS Foxpro
Hi, When we select new project ,can "MFC AppWizard(exe)" make connection to database ? or only "database project" can make connection to database ? How do i make connection to database(MS Access/Foxpro) and perform sql using MFC Appwizard(exe) with ODBC --CDatabase? Any sample code ? Thanks. CBTan wrote: > Hi, > > When we select new project ,can "MFC AppWizard(exe)" make connection > to database ? or only "database project" can make connection to > database ? > > How do i make connection to database(MS Acce...

accessing MS Access database fila via ODBC problem
Hi! I'm trying to connect to a MDB file via ODBC like this: char *DSN = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=c:\\dev-cpp\\test\\1.mdb"; SQLAllocEnv(&env); SQLAllocConnect(env, &hdbc); SQLBrowseConnect(hdbc, (UCHAR*)DSN, strlen(DSN), (UCHAR*)buf, BUF_SIZE, (SQLSMALLINT*)&rcvlen); The function SQLBrowseConnect fails and SQLGetDiagRec returns "IM001 Driver does not support this function" Can anyone help me? Thanks! David On S...

How to connect a remote MS Access/MS SQL Database from JSP on Linux?
I want to use JDBC to connect a remote MS Access/MS SQL database, however, I found that JDBC-ODBC is not support on remote database and Linux. I've visit the site of some middleware, like RmiJdbc, IDS,.... However, seems don't know how to make it functions and difficult to configure. Do anyone can give me a solution? Thanks Vincent ...

Possible to access MS Access 2007 password-protected database from Python?
Googling has shown me various ways of connecting to a non-password- protected Access database, but I was wondering if someone could point to code illustrating how to use an Access db that's password- protected. I haven't been able to find anything on this. Thanks, Ken ...

Problems with MOD-Function by accessing MS-Access Database via SQL in Delphi
Hello, the following problem: I use Delphi 6 to access a MS Access Database. In short, the Delphi Code looks like this: ADOConnection1.Open; ADOQuery1.Close; ADOQuery1.SQL.Text :=3D 'SELECT * FROM database1 WHERE value1=3D1 AND value2=3D ' + inttostr(array[3]); ADOQuery1.Open; Label5.Caption:=3DADOQuery1.Fiel=ADdByName('value4').AsString; Now I only want to select these rows, where the Integer value3 ends on 1=2E So I need the Modulo-Function. I found in the Internet these two functions: MOD(x,y) und x % ...

Java Applets connecting to Databases: access denied (java.net.SocketPermission ... resolve)
Hi folks,I'm new about developing Java applets and I need some help.I'm developing a Web Application based on JSPs and Tomcat in Netbeans.I've also developed a Java Applet which its package has some classes.This Applet connects to a Sybase Database (JConnect) in order to querysome information. It works fine when I run the Applet Class atNetbeans.The Jar containing this Applet (and the Jar supporting the DB driver)is embedded into a JSP of my Web Application through JSP Plugin tag.When I call for this JSP (where the Applet is embedded) I get thiserror (at the Client Java Console):ja...

SN#10373 Tutorial on Java[TM] DataBase Connectivity API Database Access
SYSTEM NEWS FOR SUN USERS Vol 65 Issue 2 2003-07-07 Article 10373 from section "Java Technology" "Keeping Simple Things Simple" The tutorial on Java[TM] DataBase Connectivity (JDBC[TM]) API Database Access by Maydene Fisher covers the basics of the API features of version 2.0. Fisher states, "The JDBC API was designed to keep simple things simple. This means that the JDBC API makes everyday database tasks, like simple SELECT statements, very easy." This trail (section in the tutorial) is divided i...

Problem with MS Access Database
------=_NextPart_000_0038_01C56A17.539605A0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Hello, I'm using wxWidgets now a long time for designig my applications. This weekend I tried first to use the Database classes, but I've got a problem with them... I've got an Microsoft Access Datenbase, with two tables: Orte(ID, Staat, Name, and so on) PLZOrte(ID, PLZ) This tables are set into a relationship. The field ID ist the primary key in Orte and set up the relation. Now I'd like to do a query to this database in my...

MS Access database connection
I try to be connected to an Access database without success. I write on matlab command Window: connexionA = database(&#8216;ke_db&#8217;, &#8216;UserSys&#8217;, &#8216;#Pwd!18&#8364;Sys#') and I have received "error message". Please can you help? Thanks in advance, ...

to connect the MS Access database
how can i call the report that i need in MS Acces database, from matlab??? ...

Problem connecting to an access database
Hi I'm a student Informatica in Belgium. We get classes Visual Basic here and where now bussy with the subject databases. I work on my laptop where i've installed an Win XP OS with an Office 2000. The problem now is that i'm not abble to connect to my access database. I have an DATA object on my form and this has an property connect and almost everybody in my class has the option Access 2000, only with a few of us, we only have the option Access. Evertime I try to run the program i get an error. That he cant connected to such a database type. "Unrecongnized database format....

Problem connecting to an access database
Hi I'm a student Informatica in Belgium. We get classes Visual Basic here and where now bussy with the subject databases. I work on my laptop where i've installed an Win XP OS with an Office 2000. The problem now is that i'm not abble to connect to my access database. I have an DATA object on my form and this has an property connect and almost everybody in my class has the option Access 2000, only with a few of us, we only have the option Access. Evertime I try to run the program i get an error. That he cant connected to such a database type. "Unrecongnized data...

Ms. Access database problem
Hello, I have a MS. Access database in XP. When I open the database in design view, users will get an error message & cannot even open the database. Is there any way to solve this problem? Thanks for your help in advance. Orchid What error message? Did you try the standard compact/repair routine? Thanks for your reply! The error message is: "The database has been placed in a state by user 'Admin' on machine 'Name' that prevents it from being opened or locked." Yeah, I tried the standard compact/repair routine, (which is under Tool, Database Utilities, Com...

Oracle JDBC connect problems-ojdbc6.jar using Native Java commands OK from Matlab,but database toolbox not working -pls help with database toolbox configuration
Hi, I am having some trouble using oracle and jdbc drivers. When I use the native java commands it works from Matlab and I can connect to a database, here is how I do this: javaaddpath('T:\tmp\ojdbc6.jar') aa = oracle.jdbc.pool.OracleDataSource() aa.setDriverType('thin') aa.setNetworkProtocol('tcp') aa.setDatabaseName('TESTDB') aa.setServerName('192.0.0.1') aa.setPortNumber(1521) aa.setUser('testuser') aa.setPassword('testpassword') aa.setServiceName('TESTING') conn = aa.getConnection() stmt = conn.createState...

MS Access Database SQL Problem
Hello, I'm a Belgian student and I'm having a problem with SQL in cobol. At school we use a simple MS Access database. An example of a table "Student" in the database could be: Student ------- id Automatic Numeration name Text adress Text age Numeric The problem is that I can only read fields with the type "Text". I use this code: ******************************************************* $SET SQL(dbman=ODBC, pass=admin, init, db=student) .... Working-storage section. EXEC SQL INCLUDE SQLCA END-EXEC EXEC SQL BEGIN DECLARE SECTION END-EXEC. 01 sstud...

JDBC connecting to MS Access Problem??
Hai all, I am working these days with JDBC and I could make simple program that read from a MS Access DataBase ??? BUT...then I've faced a problem when I was trying to read an image ( OLE Object ) from the data base ???? Some People advised me to use the BLOB Object, and I've read about it....but I could'nt understand how to use it to insert the picture on a JAVA user interface...??? I hope you understood the problem..... Looking forward to hearing from you... Thanx alot, "Rashrashetta" <rasha_cs_99@hotmail.com> wrote in message news:6c999f04.0502101300.bb87a85@po...

Connecting to an access database using java
I really want to know how to connect to an accessXP database using Java. If you know the technique including driver class, etc. please include as much as you can. Thanks a lot! In article <a150c3e2.0307211740.b65196c@posting.google.com>, wozthejedi@yahoo.com says... > I really want to know how to connect to an accessXP database using > Java. If you know the technique including driver class, etc. please > include as much as you can. Thanks a lot! > The magic incantation is: public Connection openMDB( File mdb_file, boolean exclusive ) throws IOExcepti...

Connecting to MS Access Using Java
hi, im having toruble connecting to MS Access DB using Java. This is the code i used: public void connect(){ try { Class.forName("sun.jdbc.odbc.JbdcOdbcDriver"); } catch (ClassNotFoundException e) { e.printStackTrace(); } String databaseName = "invent"; String url = "jdbc:odbc:" + databaseName; String loginName = "Admin"; String password = "lace"; try { ...

UPDATING MS Access database problem
Hi! Why does my database not update? Code: //////////////////////////////// Connection con; ms_database = "jdbc:odbc:knjiznica"; Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con = DriverManager.getConnection (ms_database, "", ""); Statement st= con.createStatement(); int rs = st.executeUpdate("UPDATE TABLE SET date='"+ date +"' WHERE number = "+ num +""); ///////////////////////////// There's no exception but also no result in database... date is a String type, num is int Plea...

jdbc connection to MS access database
Im trying to connect my database. im using ms access when i try to execute my program it gives me this error i create my database by going to the odbc in the administrative tools. and when i try to execute my code it gives me this error: java.sql.SQLException: No suitable driver at java.sql.DriverManager.getConnection(DriverManager.java:545) at java.sql.DriverManager.getConnection(DriverManager.java:193) at Transit.main(Transit.java:16) and this is the code im using. try{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); } catch(Exception e){ ...

Help connect Ms access database
Hello All, I am trying to connect an MS database without utilizing the help of the "querybuilder", I know how to do that using the "querybuilder" but this can't work as I am trying to do an exe file and be able to use it for other pc's that I have. I am doing the following, please correct me if I am wrong, but it is not working at all: dbpath=[matlabroot,'a\toolbox\database\dbdemos\trial.accdb']; conurl = ['jdbc:odbc:Driver={Microsoft Access Driver (*.mdb,*.accdb)};' ... 'DBQ=' dbpath] conn=database('Trial_now','','&#...

Web resources about - Problem while connecting to MS Access 2007 - comp.lang.java.databases

Connecting rod - Wikipedia, the free encyclopedia
In a reciprocating piston engine , the connecting rod or conrod connects the piston to the crank or crankshaft . Together with the crank, they ...

COVER BOY: Dec. 15 Issue of ‘Time’ Features Mark Zuckerberg on Connecting the World
The cover of the Dec. 15 issue of Time features a familiar face — that of Facebook co-founder and CEO Mark Zuckerberg , the star of a long feature ...

Digital Media Wire - connecting people & knowledge —
dmwnews : Anomaly, the ambitious graphic novel by Brittenham and Haberlin, features augmented reality. http://bit.ly/Iwrxjr Already optioned ...

Connecting People to Brands and Products on Mobile
People come to Facebook not only to connect with friends and family but also with products and brands. Here's how we're making it easier to list ...

What stops users from connecting with an app through Facebook?
... This equals 850 million users who connect with apps using Facebook at a 59 percent conversion rate. About 590 million users back out of connecting ...

Home - WHLT 22 Connecting the Pine Belt Fan
Facebook is a social utility that connects people with friends and others who work, study and live around them. People use Facebook to keep up ...

US IT Staffing Recruiters Group - Connecting Ideas !
US IT Recruiter's Groups: IT Technical Recruitment. Its all about connecting to new Ideas !

Cold Christmas Bubbles - A Cool Connecting Dots Puzzle for Kids on the App Store on iTunes
Get Cold Christmas Bubbles - A Cool Connecting Dots Puzzle for Kids on the App Store. See screenshots and ratings, and read customer reviews. ...

Connecting a Relay to Arduino - Flickr - Photo Sharing!
Simple circuit to connect a 5V relay to one of the digital output pins of the Arduino. I drew this after a few threads showed up on the Arduino ...

Evidence Connecting Scott Roeder to Operation Rescue Found in Roder's Car - YouTube
Rachel Maddow unveils video evidence from KMBC TV in Kansas City of a note found in Scott Roeder's car at the time of his arrest for the murder ...

Resources last updated: 3/2/2016 12:07:13 PM