Muhammad.R1
Active Member
- Joined
- Sep 8, 2007
- Messages
- 67
- Reaction score
- 1
Hey guys
When i run by Netbeans project, i get the following error:
"[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified"
The thing is im running Netbeans 7.2 at home but on my school computer (which is running 6.9),when I run the project... It works fine and database connection succeeds!
Could anyone tell me what is wrong with it?
I've done all thats required such as saving my database as a 2002-2003 format .mdb and the correct coding in my connect.java class.
Thanks
P.S The coding that works on 6.9 but not on 7.2 is located below:
UPDATE: I've installed Netbeans on my laptop and after running it,my project ran fine.
My computer is still new so i assume that theres some application or drivers i'm missing since its working on all computers except mine.. I have the latest JRE , drivers for hardware and Framework.
When i run by Netbeans project, i get the following error:
"[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified"
The thing is im running Netbeans 7.2 at home but on my school computer (which is running 6.9),when I run the project... It works fine and database connection succeeds!
Could anyone tell me what is wrong with it?
I've done all thats required such as saving my database as a 2002-2003 format .mdb and the correct coding in my connect.java class.
Thanks
P.S The coding that works on 6.9 but not on 7.2 is located below:
Code:
import java.sql.*;
import java.util.Scanner;
import java.io.*;
import javax.swing.ImageIcon;
public class Connect
{
Connection conn;
Scanner kb = new Scanner (System.in);
public Connect()
{
//load the driver
try
{
Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");
System.out.println ("Driver successfully loaded");
}
catch (ClassNotFoundException e)
{
System.out.println (e.getMessage());
}
//connect to the database
try
{
String filename = "StarWars.mdb";
String database = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb,*.accdb)};DBQ=";
database += filename.trim () + ";DriverID=22;READONLY=true}";
conn = DriverManager.getConnection (database, "", "");
System.out.println ("Connection to database successfully established");
}
catch(Exception e)
{
System.out.println (e.getMessage());
}
}
UPDATE: I've installed Netbeans on my laptop and after running it,my project ran fine.
My computer is still new so i assume that theres some application or drivers i'm missing since its working on all computers except mine.. I have the latest JRE , drivers for hardware and Framework.
Last edited: